通用模板如下: Serilog: Using: - "Serilog.Sinks.Console" MinimumLevel: Default: Information Override: Microsoft.AspNetCore.HttpLogging:[......]继续阅读

2024年12月30日 0条评论 1342点热度 1人点赞 痴者工良 阅读全文

Serilog: Using: - "Serilog.Sinks.Console" MinimumLevel: Default: Information Override: Microsoft.AspNetCore.HttpLoggin[......]继续阅读

2024年12月30日 0条评论 98点热度 1人点赞 痴者工良 阅读全文

t4 模板文件 第一步,在项目中设置 t4 模板文件。 不知道 T4 模板的,可以自行查阅资料或查看 https://learn.microsoft.com/zh-cn/visualstudio/modeling/code-generation-and-t4-text-templates?view[......] 继续阅读

2024年5月7日 0条评论 3864点热度 2人点赞 痴者工良 阅读全文

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[......] 继续阅读

2024年5月7日 0条评论 118点热度 2人点赞 痴者工良 阅读全文

整体逻辑 ASP.NET Core gRPC 的使用很简单,服务注册和中间件只有两行代码。 var builder = WebApplication.CreateBuilder(args); // Add services to the container.[......]继续阅读

2024年4月3日 0条评论 3592点热度 2人点赞 痴者工良 阅读全文

Overall Logic Using ASP.NET Core gRPC is very straightforward; service registration and middleware require only two lines of code. var builder[......]继续阅读

2024年4月3日 0条评论 100点热度 2人点赞 痴者工良 阅读全文

模型类: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API 接口: [HttpPost("aaa")[......]继续阅读

2023年9月19日 0条评论 1783点热度 0人点赞 痴者工良 阅读全文

Model Class: public class Test { [JsonConverter(typeof(string))] public int Value { get; set; } } API Interface: [HttpPost("aaa")][......]继续阅读

2023年9月19日 0条评论 104点热度 0人点赞 痴者工良 阅读全文

部署 Apollo 之后,创建一个应用。 然后创建命名空间,选择 private 创建私有命名空间,选择 json 格式。 点击修改文本,填入 json 内容。 然后在 .NET 程序中引入包 <PackageReference Include="Com.Ctrip.F[......]继续阅读

2023年9月11日 0条评论 1716点热度 0人点赞 痴者工良 阅读全文

Deploy Apollo and create an application. Then create a namespace, select private to create a private namespace, and choose the json format. Click mo[......] 继续阅读

2023年9月11日 0条评论 64点热度 0人点赞 痴者工良 阅读全文

首先是中间件,它决定了有时间显示哪些分组。 可以从 IApiDescriptionGroupCollectionProvider 服务中获取所有 API,然后通过 API 进行识别,检查是否有分组。 if (context.HostingEnvironment.I[......]继续阅读

2023年8月15日 0条评论 2330点热度 2人点赞 痴者工良 阅读全文

First is the middleware, which determines which groups to display when there is time. All APIs can be obtained from the IApiDescriptionGroupCollectio[......] 继续阅读

2023年8月15日 0条评论 68点热度 2人点赞 痴者工良 阅读全文

本文内容: JWT Token JWT Token颁发 JWT 签名验证 JWT 安全检验 Token 原理 打开 https://jwt.io/ ,进入后会看到默认页面有一段自动生成的 token,右边是关于这个 token 的信息。 可以看到默认有一段 token: e[......]继续阅读

2023年1月13日 0条评论 3090点热度 2人点赞 痴者工良 阅读全文

本文内容: JWT Token JWT Token Issuance JWT Signature Verification JWT Security Check Token Principles Visit https://jwt.io/ to see a default page wi[......] 继续阅读

2023年1月13日 0条评论 72点热度 2人点赞 痴者工良 阅读全文

ASP.NET Core Response.Body 默认是 HttpResponseStream,其主要特征是只能追加写,不能读取也不能修改。 所以最根本方法是替换 HttpResponseStream。 随便设置一个中间件,或者将 HttpContext 拿出来,定义变量 context。 替[......] 继续阅读

2022年9月30日 0条评论 3008点热度 0人点赞 痴者工良 阅读全文

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[......] 继续阅读

2022年9月30日 0条评论 622点热度 0人点赞 痴者工良 阅读全文

public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读

2022年6月24日 0条评论 74点热度 2人点赞 痴者工良 阅读全文

public class TestNoopHostLifetime : IHostLifetime { public Task StopAsync(CancellationToken cancellationToken) { C[......]继续阅读

2022年6月24日 0条评论 2904点热度 2人点赞 痴者工良 阅读全文

public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilde[......]继续阅读

2022年6月24日 0条评论 86点热度 1人点赞 痴者工良 阅读全文

public async static Task (this IApplicationBuilder app) { app.ApplicationServices.GetRequiredService<ObjectAccessor<IApplicationBuilder[......]继续阅读

2022年6月24日 0条评论 2177点热度 1人点赞 痴者工良 阅读全文
1234510