通用模板如下: Serilog: Using: - "Serilog.Sinks.Console" MinimumLevel: Default: Information Override: Microsoft.AspNetCore.HttpLogging:[......]继续阅读
通用模板如下: Serilog: Using: - "Serilog.Sinks.Console" MinimumLevel: Default: Information Override: Microsoft.AspNetCore.HttpLogging:[......]继续阅读
Serilog: Using: - "Serilog.Sinks.Console" MinimumLevel: Default: Information Override: Microsoft.AspNetCore.HttpLoggin[......]继续阅读
t4 模板文件 第一步,在项目中设置 t4 模板文件。 不知道 T4 模板的,可以自行查阅资料或查看 https://learn.microsoft.com/zh-cn/visualstudio/modeling/code-generation-and-t4-text-templates?view[......] 继续阅读
T4 Template Files The first step is to set up T4 template files in the project. If you are unfamiliar with T4 templates, you can look up information[......] 继续阅读
整体逻辑 ASP.NET Core gRPC 的使用很简单,服务注册和中间件只有两行代码。 var builder = WebApplication.CreateBuilder(args); // Add services to the container.[......]继续阅读
Overall Logic Using ASP.NET Core gRPC is very straightforward; service registration and middleware require only two lines of code. var builder[......]继续阅读
模型类: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API 接口: [HttpPost("aaa")[......]继续阅读
Model Class: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API Interface: [HttpPost("aaa")][......]继续阅读
部署 Apollo 之后,创建一个应用。 然后创建命名空间,选择 private 创建私有命名空间,选择 json 格式。 点击修改文本,填入 json 内容。 然后在 .NET 程序中引入包 <PackageReference Include="Com.Ctrip.F[......]继续阅读
Deploy Apollo and create an application. Then create a namespace, select private to create a private namespace, and choose the json format. Click mo[......] 继续阅读
首先是中间件,它决定了有时间显示哪些分组。 可以从 IApiDescriptionGroupCollectionProvider 服务中获取所有 API,然后通过 API 进行识别,检查是否有分组。 if (context.HostingEnvironment.I[......]继续阅读
First is the middleware, which determines which groups to display when there is time. All APIs can be obtained from the IApiDescriptionGroupCollectio[......] 继续阅读
本文内容: JWT Token JWT Token颁发 JWT 签名验证 JWT 安全检验 Token 原理 打开 https://jwt.io/ ,进入后会看到默认页面有一段自动生成的 token,右边是关于这个 token 的信息。 可以看到默认有一段 token: e[......]继续阅读
本文内容: JWT Token JWT Token Issuance JWT Signature Verification JWT Security Check Token Principles Visit https://jwt.io/ to see a default page wi[......] 继续阅读
ASP.NET Core Response.Body 默认是 HttpResponseStream,其主要特征是只能追加写,不能读取也不能修改。 所以最根本方法是替换 HttpResponseStream。 随便设置一个中间件,或者将 HttpContext 拿出来,定义变量 context。 替[......] 继续阅读
ASP.NET Core Response.Body is by default an HttpResponseStream, which is characterized by allowing writes only in append mode, and it cannot be read o[......] 继续阅读
public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读
public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读
public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilde[......]继续阅读
public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder[......]继续阅读