.net 支持插件系统的 类库
https://github.com/natemcmaster/DotNetCorePlugins
|
4
|
|
5 字
|
几秒读完
.net 程序集扫描类 Scrutor
https://github.com/khellang/Scrutor 可扫描 实现了一个装饰器 扫描 var collection = new ServiceCollection(); collection.Scan(scan => scan // 从 ITransientService 接口所在的程序集开始扫描 .FromAssembly…
|
2
|
|
79 字
|
3 分钟
AutoFixture 简单介绍
- 在单元测试中自动生成随机的测试数据 Fixture fixture = new(); var items = fixture.Build<ListItem>() .With(it => it.Idx, Random.Shared.Next()) // 配置为所有实例都使用该值 .Without(it => it.Desc…
|
138
|
|
33 字
|
1 分钟内
Redis 一些资料
【GeekHour】一小时Redis教程 https://www.bilibili.com/video/BV1Jj411D7oG 一些应用场景 https://juejin.cn/post/7325132133168971813 StackExchange.Redis 中文文档目录 https://www.cnblogs.com/liang24/t…
|
142
|
|
50 字
|
几秒读完
Swagger 配置
# 进行参数修改 builder.Services.AddSwaggerGen(opt => {}); 修改标题 opt.SwaggerDoc("v1", new OpenApiInfo { Title = "Test01", Version = "v1", }); 在 header…
|
207
|
|
178 字
|
5 分钟
设置 task 为 STA 模式
因为要运行窗口代码,必须使用 STA 模式,而有一些代码又需要 async/await 方式 一 推荐,因为可以传入一个异步函数,并可以扩展为带返回值 # 调用 await this.RunWithStaTaskAsync(this.AppRun); private async Task RunWithStaTaskAsync(Func<Ta…
|
195
|
|
159 字
|
3 分钟
CuttingEdge.Conditions 替代
Ardalis.GuardClauses https://www.nuget.org/packages/Ardalis.GuardClauses
|
209
|
|
9 字
|
几秒读完
.net 健康度检查
[官方手册] https://learn.microsoft.com/zh-cn/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-9.0 [一个第三方库,包括各种服务的检测] https://github.com/Xabaril/AspNetCore.Diagnostics.Hea…
|
211
|
|
773 字
|
8 分钟
.http 文件使用
使用 Visual Studio 2022 中的 .http 文件 | Microsoft Learn .http 文件语法 请求:HTTP 请求的格式为 HTTPMethod URL HTTPVersion,其中 HTTP 方法可以是 GET、POST、PUT 等,URL 是请求的目标地址,HTTPVersion 是可选的。 示例: GET ht…
|
219
|
|
671 字
|
8 分钟