Table of Contents Intro New Config HttpLoggingInterceptor More References Intro .NET 6 began to introduce an http logging middleware. We can use the http logging middleware to record request and response information, but the scalability is not very strong. In the .NET 8 version, some optimizations were made and some New configuration and HttpLoggingInterceptor make […]
Tag: asp.net
ASP.NET Core Globalization and Localization Series 2
In actual work, we often use ASP.NET Core’s Globalization & Localization features and resource files. Resource files (.resx) are used to separate language strings from code. These files contain key/values items. , you can use vs to create this file, for example: Your website supports 3 cultures – French, Spanish, English, so you have to […]
ASP.NET Core Web API development practice using Dapper
In this article, we will learn how to use Dapper in an ASP.NET Core Web API project and how to use Dapper in the project for different SQL queries and executions, how to execute stored procedures, and how to create multiple queries within a transaction. In this project, we will use the repository mode Repository […]
Improvements to HttpLoggingMiddleware in ASP.NET 8
Improvements in HttpLoggingMiddleware in ASP.NET 8 Intro .NET 6 began to introduce an http logging middleware. We can use the http logging middleware to record request and response information, but the scalability is not very strong. In the .NET 8 version, some optimizations were made and some New configuration and HttpLoggingInterceptor make it easier to […]
ASP.NET Core policy authorization and ABP authorization
Policy authorization in ASP.NET Core First let’s create a WebAPI application. Then introduce the Microsoft.AspNetCore.Authentication.JwtBearer package. Strategy In the ConfigureServices method of the Startup class, the form of adding a policy is as follows: services.AddAuthorization(options => { options.AddPolicy(“AtLeast21”, policy => policy.Requirements.Add(new MinimumAgeRequirement(21))); }); Here we go step by step. services.AddAuthorization is used to add authorization […]
ASP.NET Core Model Binding – Advanced
In this section, we use examples to explain the advanced concepts of model binding. We explain them from these dimensions: 1 Model binding array type 2 Model binding collection type 3 Model binding complex collection types 4 Model binding sources 1 Model binding array type Using model binding we can bind array type parameters to […]
Use of Identity framework in ASP.NET Core
Identity framework: 1. Adopt the Role-Based Access Control (RABC) strategy, which has built-in management of user, role and other tables and related interfaces. 2. The Identity framework uses EF Core to operate the database. Identity framework usage Since the Identity framework uses EF Core to operate the database, the operation has similar expenditures as defining […]
ASP.NET Core Filter Advanced
In this section we discuss advanced topics of filters – filter dependencies, global filters, filter execution order & changing the filter order. In the previous section we introduced the basic use of filters in ASP.NET Core 1 ASP.NET Core filter dependency injection If a filter has a dependency, it cannot be applied to the action […]
ASP.NET Core updates in .NET 8 Preview 1
Table of Contents Full stack web UI using Blazor Improved authentication and authorization experience Native AOT ASP.NET Core Roadmap for .NET 8 What’s new in .NET 8 Preview 1? start Upgrade an existing project routing tools Routing constraint performance improvements New analyzer for API development It is recommended to set or append to the title […]
asp.net mvc 5 dependency injection autofac 6.4 usage examples
Step 1: After starting vs2022, create a new asp.net mvc project with the project name MvcAutofac Step 2: For testing, create two classes for testing in the Models folder, Student.cs and Boy.cs public class Student { public int Id { get; set; } public string Name { get; set; } public int Age { get; […]