C# 8 and .NET Core 3 Projects Using Azure - [2 edition.] 9781789612080

1,042 366 26MB

English Pages [520] Year 2019

Report DMCA / Copyright

DOWNLOAD FILE

C# 8 and .NET Core 3 Projects Using Azure - [2 edition.]
 9781789612080

Table of contents :
Cover
Title Page
Copyright and Credits
Dedication
About Packt
Contributors
Table of Contents
Preface
Chapter 01: Ebook Manager and Catalogue App - .NET Core for Desktop
Technical requirements
Creating a new WinForms application
Virtual storage spaces and extension methods
The DocumentEngine class
The ImportBooks form
Populating the TreeView control
Populating the storage space list
Saving a selected book to a storage space
Creating the main eBookManager form
Running the eBookManager application
Upgrading to .NET Core 3
Fixing compilation errors
Resource files
The eBookManager screen
importBooks screen
ProcessStartInfo
Benefits of upgrading to .NET Core
Understanding nullable reference types
Exploring XAML Islands
UWP TreeView
WIndowsXamlHost
ItemTemplate
TreeView Item model and ItemsSource
Removing the existing TreeView
Tree shaking and compiling to a single executable
Summary
Chapter 02: Task Bug Logging ASP.NET Core MVC App Using Cosmos DB
Technical requirements
Benefits of using Cosmos DB
Why cloud? It's Microsoft's job to scale – not yours
Why Cosmos? Compatibility with industry-leading APIs and global distribution
Setting up Azure Cosmos DB
Subscription/resource group
Account name
API
Location
Geo-redundancy/multi-region writes
Configuring the Cosmos DB instance
Connecting your ASP.NET Core MVC application to Cosmos DB
Adding the NuGet package
Creating the MongoDbRepository class
Reading and writing data to MongoDB
Creating the interfaces and WorkItemService
Creating the view
Modifying the HomeController
Adding work items
Redirecting to the list of work items
Cleaning up the resources
Summary
Chapter 03: ASP.NET Azure SignalR Chat Application
Technical requirements
Introducing SignalR
SignalR project
Configuring Azure SignalR
Creating the project
Setting up the project
Adding the SignalR libraries
Building the server
SignalR Hub subclass
Configuration changes
Creating a client
Included libraries
JavaScript functions
Naming section
Chat input
Archive function
Building and running the project
Running the application
Getting the party started
Archiving the chat
The Azure service
Cleanup
Summary
Chapter 04: Web Research Tool with Entity Framework Core
Entity Framework (EF) Core history
Code-First versus Model-First versus Database-First approach
Developing a database design
Setting up the project
Installing the required packages
EF Core SQL Server
EF Core tools
Code generation design
Creating the models
Configuring the services
Creating the database
Seeding the database with test data
Creating the controller
Running the application
Testing the application
Arrange/act/assert
In-memory database
What are we testing?
Speed
Deploying the application
Microsoft Azure App Service
Custom targets
FTP
Web Deploy
Web Deploy Package
Folder
Import profile
Summary
Chapter 05: Building a Twitter Automated Campaign Manager Using Azure Logic Apps and Functions
Technical requirements
An overview of workflow engines, logic apps, and Functions
Creating an Excel table
Building logic apps in the Azure portal
Building logic apps in Visual Studio
Azure development workload
The logic apps extension
Creating a resource group
Creating the workflow
Step 1 – Choosing a trigger
Step 2 – Reading the Excel file
New Azure function
Deploying and testing the function
Iterating through the spreadsheet
Sending a tweet
Adding a condition and removing the current row
Passing parameters to a function
Back to our condition
Deleting the row
Publishing the logic app
Failure
Cleaning up the Azure resources
Summary
Chapter 06: Stock Checker Using Identity Server and OAuth 2
Technical requirements
Visual Studio Installer – new workloads
Identity and permission
Project overview
Stock checker application API
Setup
Adding the controller and routing
Reading stock levels
Updating stock levels
Permissions
Client application
OnPropertyChanged
Commands and API calls
Helper classes
IdentityServer 4
IdentityServer
Securing the API
Client configuration
Login screen
Calling IdentityServer
Capabilities
Setting up IdentityServer
Calling the API
Grant types
Creating and using a valid key
Authorization
Users and roles
IdentityServer
Client
Logic changes and UI changes
Login and navigation changes
Server calls
How to update the quantity when you can't see it
Summary
Suggested improvements
Further reading
Chapter 07: Building a Photo Storage App Using a Windows Service and Azure Storage
Technical requirements
Windows Services and Windows Compatibility Pack
Windows Services
Windows Compatibility Pack
Project overview
Configuring Azure Storage
Hot and cold storage
Storage redundancy
Storage account
Creating our Windows Service
Testing the class
Using the Azure Storage Client 
Configuring our Service to Access Azure Storage
Finishing off the Cloud Storage Client
Further configuration
Logging
Only uploading images
Uploading existing images
Installing the Windows Service
Code changes
Installation command
Testing and debugging
Step 1 – check the service is running
Step 2 – check the log file
Step 3 – check the Event Viewer
Summary
Chapter 08: A Load-Balanced Order Processing Microservice Using Docker and Azure Kubernetes Service
Technical requirements
JMeter
Microservices
Exploring Docker
Kubernetes and orchestration
Creating our microservice
Queues
Sales order generator
The Service bus helper library
Testing our sales order generator and JMeter
JMeter
Logging
Creating a new microservice
Creating our new Docker Container
Creating the microservice logic
Creating a new Azure SQL database
Entity Framework Core
Creating the sales order
The storage queue
Azure Kubernetes Service
Building a Docker image
Azure Container registry
Azure Container Registry
Azure Kubernetes Service
Kubernetes deployment
Load balancing
Cleanup
Summary
Chapter 09
: Emotion Detector Mobile App - Using Xamarin Forms and Azure Cognitive Services
Technical requirements
Concepts overview
Machine learning
Cross-platform and mobile development
Project overview
Configuring Azure Cognitive Services
Creating the Xamarin application
Taking a picture
Xamarin plugins
Media plugin
TakePicture()
GetEmotionAnalysis()
DisplayData()
CreateLabel()
GetStrongestEmotion()
Button_Clicked
Testing and running on a physical device
Summary
Chapter 10: Eliza for the 21st Century - UWP and the MS Bot Framework
Technical requirements
Creating a chatbot
Bot emulator
Echo Bot – Except for Hello
Introducing LUIS
Integrating LUIS into the Bot Framework
Upgrading the template from .NET Core 2.1 to 3.0
UseMvc
AllowSynchronousIO
Intent/response matrix
Publishing the bot
Creating a Channel Registration
MicrosoftAppId and MicrosoftAppPassword
Creating a UWP application
MainPage
Row definitions
ListView
Message and command binding
Data binding and view models
ObservableCollection
Command binding
DirectLineWrapper
Models
RelayCommandAsync
Channels
Direct Line and Web Chat
Bot client
Summary
WebAssembly
Why WebAssembly
Reason one – statically typed
Reason two – compiled
Reason three – speed
Reason four – languages that you know/same language in the frontend and backend
Reason five – existing code
Reason six – deployment
Reason seven – security
Writing WebAssembly
Understanding Blazor
Other Books You May Enjoy
Index

Polecaj historie