https://livebook.manning.com/book/asp-net-core-in-action-second-edition https://github.com/andrewlock/asp-dot-net-core-in-action-2e
Chapter 1. Getting Started
- Constructs HttpContext
Part 2. Building complete applications
3 Handling requests with the middleware pipeline
- DeveloperExceptionPageMiddleware
- ExceptionHandlerMiddleware
- 3.18 figure (shows how the error page redirect flow works). Re-executing, in-memory
- errors during re-execution are dangerous
- StatusCodesMiddleware
- Summary ⭐
4 Creating a website with Razor Pages
- Razor Pages > MVC
- Actions in Controllers vs Razor Pages handlers
- 4.2.3 When to choose MVC controllers over Razor Pages
- 4.3.2 Returning responses with ActionResults
- Summary ⭐
5 Mapping URLs to Razor Pages using routing
- 5.4.2 Adding additional constraints to route parameters
- RedirectToAction/RedirectToPage vs IUrlHelper vs LinkGenerator
- 5.7 Customizing conventions with Razor Pages
- You can control the routing conventions used by ASP.NET Core by configuring the RouteOptions object, such as to force all URLs to be lowercase, or to always append a trailing slash.
- AddRazorPagesOptions
- AddPageRoute (adds extra route template)
- Summary ⭐
6 The binding model: Retrieving and validating user input
- Binding sources: form values, route values, query string values
- FromHeader, FromBody, FromForm, FromQuery, FromRoute
- ModelBinderAttribute
- Binding model, Model State
- System.ComponentModel.DataAnnotations
- ModelState.ModelStateDictionary
7 Rendering HTML using Razor views
- Summary ⭐
8 Building forms with Tag Helpers
- Summary ⭐
9 Creating a Web API for mobile and client applications using MVC
- Content negotiation and input/output formatters
10 Service configuration with dependency injection
- Summary ⭐
11 Configuring an ASP.NET Core application
- Summary ⭐
12 Saving data with Entity Framework Core
13 The MVC and Razor Pages filter pipeline
- Authorization filters—IAuthorizationFilter or IAsyncAuthorizationFilter
- Resource filters—IResourceFilter or IAsyncResourceFilter
- Action filters—IActionFilter or IAsyncActionFilter
- Page filters—IPageFilter or IAsyncPageFilter
- Exception filters—IExceptionFilter or IAsyncExceptionFilter
- Result filters—IResultFilter or IAsyncResultFilter
- IOrderedFilter
- ActionFilterAttribute:IResultFilter,IActionFilter
- contex.Result - short-circuit the pipeline
- ControllerBase implements IActionFilter so you can override it for single Controller case.
- Exception Filters won't catch exception in resource and result filters that why it is important to not throw errors in them
- ExceptionFilterAttribute
- ResultFilterAttribute
- FormatFilterAttribute, ProducesAttribute
- context.HttpContext.Response.GetTypedHeaders().LastModified
- IResultFilter does not invoked in case of short-circuting, if you don want this to happen use IAlwaysRunResultFilter
- TypeFilerAttribute and ServiceFilerAttribute in relation to DI
- Listing: 13.8
- IFilerFactoryIFilerFactory
- Summary ⭐
14 Authentication: Adding users to your application with Identity
- Summary ⭐
15 Authorization: Securing your application ⭐
- Policy>requirements>handlers
- Summary ⭐
16 Publishing and deploying your application
17 Monitoring and troubleshooting errors with logging
- Summary ⭐
18 Improving your application’s security
- This chapter has been a whistle-stop tour of things to look out for
- Summary ⭐
19 Building custom components ⭐
- Building custom middleware
- Creating simple endpoints that generate a response using middleware
- Using configuration values to set up other configuration providers
- Replacing the built-in DI container with a third-party container
- https://github.com/andrewlock/NetEscapades.AspNetCore.SecurityHeaders
- Listing 19.7, creating middlewaremiddleware
- RoutingMiddleware, EndpointMiddleware
- Listing 19.9
- IEndpointConventionBuilder
- Summary ⭐
20 Building custom MVC and Razor Pages components
21 Calling remote APIs with IHttpClientFactory ⭐
- Summary ⭐
22 Building background tasks and services ⭐
- background service + polling + cache pattern to pull data from system and use it on demand from cache
- https://github.com/andrewlock/asp-dot-net-core-in-action-2e/blob/master/Chapter22/B_BackgroundServiceDatabaseCache/BackgroundServiceDatabaseCache/ExchangeRatesHostedService.cs
- https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-5.0&tabs=visual-studio#queued-background-tasks-1
- Summary ⭐
23 Testing your application