.NET 6 introduction
.NET 6 is the main implementation of .NET going forward.
- What and Why
- Understanding .NET 6: .NET Framework versus .NET 6
- Supporting multiple runtimes
- What is .NET Standard?
Visual Studio for ASP.NET Core
So what is new in Visual Studio for .NET 6 and ASP.NET Core?
- Visual Studio 2022
- Developing with the Hot Reload
- Creating your own NuGet packages with .NET Core
- Pinning the .NET SDK with global.json
Modern C# Language Features You Need to Know
.NET 6/7 now uses C# 10/11, which contains many exiting new language
features you need to knowledge to build better software with .NET 6/7.
- Enabling the latest C# features
- Nullable Reference Types
- Implicit Usings and File Scoped Namespaces
- Value Tuples
- C# Pattern Matching
- Init-only Properties and Records
- Target Typed Expressions
- Top-level Programs
- Generic Attributes
- Raw String Literals
- Required Members
ASP.NET Core Pipeline
ASP.NET Core is several times faster than ASP.NET Framework. How did they
do this? By removing all 'fat' from the request processing. Here you will
learn how the configure the ASP.NET Core pipeline, and we will examine
some of the built-in middleware.
- Understanding the principle of the ASP.NET Core Pipeline
- Configuring the pipeline in the Program class
- Understanding Dependency Injection
- Diagnostic Middleware
- Using HTTPS and the HSTS header
- Serving Static Files
- Configuring Routing
- Exploring other built-in middleware
- LAB: Building an ASP.NET Core web site by configuring middleware
Building Custom Middleware for ASP.NET Core 6
The Open Web Interface for .NET brought a simple standard way for building
web servers with .NET. ASP.NET Core built upon this standard and with it
you can easily build your own custom extensions.
- Building your own custom middleware
- Testing your middleware
- LAB: Building a custom middleware class and testing it
ASP.NET Core Configuration
ASP.NET Core allows you to pick and choose where to store your
configuration. No more deploying configuration with production settings in
source control! We will look at the idea behind this and of course how to
choose your ideal configuration.
- Different ways of getting configuration to your code
- Storing sensitive configuration in Secrets
- Using Azure App Configuration
- Adding your own configuration provider
- LAB: Using ASP.NET Core Configuration and Feature Toggles
Proper logging is essential to find problems while developing and in
production. .NET 6 brings a unified logging approach which you can use
anywhere in .NET and also works with your preferred logging framework such
- Why do we need another logging framework?
- Choosing from different logging providers
- Understanding logging scopes
- Using the HTTP Logging Middleware
- An example: Using NLog with .NET Core 6/7
Filters allow to you add behavior in the request processing pipeline to
keep repetitive code out of your controllers.
- How Filters Work
- Authorization Filters
- Action Filters
- Result Filters
- Exception Filters
- Filters versus Middleware
Advanced Razor Techniques
- Using CSS Isolation for Razor Views
- Cleaner Razor with TagHelpers
- Building Custom TagHelpers
- Understanding and Creating View Components
- Display and Editor Templates
- Service Injection
- LAB: Creating your own tag helper and view component
With .NET 6 we get a new model for building web apps: Minimal API. This
does change some of the ways you work with ASP.NET Core.
- Benefits of Minimal APIs
- Routes and Handlers
- Model Binding and Return Types
- Code Organization
- .NET 7 Endpoint Filters
- .NET 7 Route Groups
- LAB: Managing Contacts with Minimal APIs
So you want to host a React app with an ASP.NET Core backend? It's less
straight-forward than you might think.
- Visual Studio Templates
- Using a Proxy and CORS
- Azure Templates for Angular and React
Add real-time web functionality to your application.
- What is SignalR?
- Server Concepts
- LAB: Building an emergency dashboard with SignalR
Building Single Page Applications with C# and Blazor
Building Single-Page Applications (SPA) is a very popular way of building
applications on the web. Angular, VueJs, React and others can be used to
whole new series of tools for developing these applications. But not any
longer! Now you can use C# (and Visual Studio) and apply all those skills
learned over the years to build SPAs with Blazor. Blazor makes building
interactive client-side web applications efficient and fun that work on
any modern browser.
- Introducing Blazor and Web Assembly
- Client-Side vs. Server-Side Blazor
- Creating a simple Blazor Component
- Hosting Blazor
- LAB: Building a simple Blazor application
Efficient Communication with gRPC
With gRPC you can setup efficient communication between two parties using
modern Remote Procedure Call.
- What is gRPC?
- Defining your contracts
- Implementing your contracts on the server
- Generating a Proxy and using it on the client
The world is a big place, with many spoken languages. If you want to reach
the world, you should build multi-language support in from the beginning.
- Display Content in Different Cultures
- Using resource files
- Autodetect Cultures
- LAB: Adding language support to an ASP.NET Core web site
Understanding Claims-Based Security
So what will you allow your user to do? This most likely depends on the
role the user has in your organization. This role is now represented with
claims. In this chapter you will get a better understanding why claims are
better than roles, and how claims are transmitted in a secure way as
- Representing the user
- Introducing claims-based security
- Understanding tokens and their representation on the net
- Using Claims in .NET
- LAB: Authenticating a web site with claims
Modern web Authentication and Authorization
In the modern web we all want to share stuff. But how do you safely allow
one web site to access resources from another web site? With OpenID
Connect you can delegate authentication to an identity provider (such as
Facebook, Azure AD, Identity Server and others).
- The Internet and a way of sharing
- Introducing OAuth and OpenID Connect
OAuth Fundamentals: Authorization Code Grant, Implicit Grant and Client
Implementing OpenID Connect web sign-in with AzureAD and Identity Server
- LAB: Protecting your ASP.NET Core site with OpenID Connect
Protecting a Web-API with OAuth
Modern web sites and mobile appls consume REST services. You can use
OpenID Connect to authenticate users, after which you can use claims to
authorize resources stored in a web API.
- Protecting a Web API's Resources
- Adding permissions to the Server Side
- Requesting Permissions at the Client Side
- Using the Microsoft Authentication Library (MSAL)
- User Consent
- LAB: Getting an access token and passing it to the server
Publishing Your Application
So you have finished a working version of your application. How do you
deploy this? What are the options? Since .NET is cross-platform, you can
build everything on Windows, and then run on Linux. You could even deploy
your application to a Docker container! We will also discuss various
deployment options, such as assembly trimming.
- Deployment Options
- Cross-platform Deployment
- Self-Contained Deployment
- Optimize your deployment with Assembly Trimming
- Deploying to Containers
Azure App Services: Web Apps
So you want to host your web site. But what about scalability,
fault-tolerance, HTTPS and other things? The cloud can make this a lot
easier for you.
- Deploying from Visual Studio
- Configuring app settings, TLS, domain names and backup scheduling
- Monitoring your Web API
LAB: Manually deploying your web site and database in Azure App Services