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: .net
.NET Framework 4.8 console application in C# accesses the established database through EF
Table of Contents 1. Create a .NET Framework 4.8 console application 2. Establish a database 1. Establish database Blogging in SSMS 2. Create a new database connection on VS 3. Install the EF package 4. Automatically generate EF models and contexts 1.Blog.cs class model 2. Model of Post.cs class 3.BloggingContext.cs database context 5. Write an […]
Encapsulation and use of JWT in ASP .NET Core
JWT principle: JWT principle Configuring JWT (1) Write the JWT configuration node, and create two configuration items SecKey and ExpireSeconds under the node, which represent the key and expiration time of the JWT respectively (I configured it here in appsettings.json, the expiration time unit is seconds, you can adjust it according to your own situation […]
Develop a modern .NetCore console program, including dependency injection/configuration/logging and other elements
1Foreword There are a lot of scenarios where gadgets need to be developed recently. Last time I developed a hive export tool using the go language. The experience was pretty good, but I really don’t like the syntax of the go language. This time I will try to use C# to develop gadgets. The function […]
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 […]
Dynamic compilation technology based on .NET6 in C#
A few days ago, I had to solve a dynamic calculation problem and tried different methods. The problem is that given a string containing calculations, the calculation results are obtained while the program is running. At that time, dynamic compilation was considered and I checked some information on the Internet to complete this function. However, […]
.net core webapi implements localization
Nowadays, projects often require support for localized configuration. There are many ways to achieve localized configuration. For example, Microsoft’s official website provides localized configuration through resx resource files and PO files. However, the scalability of resx resource files is not good, and PO files need to introduce dependency packages. This article mainly introduces another scalable […]
Install Windows SDK 7.1 and .NET4 on Windows 10 64-bit
Purpose: Successfully installed window sdk7.1 and .NET Framework 4 on window10 Requirements: support some older software written in Visual Studio 2010 using Windows SDK 7.1 Steps: 1. Uninstall .NET Framework 4 or above If a version of .NET Framework 4 or above is installed, problems may occur when installing .NET 4 even if sdk7.1 is […]
.NET high-performance development-bitmap index
First, let’s assume such a business scenario. Everyone should be familiar with air tickets. When purchasing air tickets, you first select your desired departure and arrival city and time, then select the cabin class (business class, economy class), and click Query. A flight list will appear. If you click on a flight at will, you […]