上一页 1 2 3 4 5 6 ··· 15 下一页
摘要:services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); c.AddSecurityDefinition("Bearer", new OpenApiS 阅读全文
posted @ 2020-08-19 14:07 IWing 阅读(56) 评论(0) 推荐(0) 编辑
摘要:services.AddCors(options => { options.AddPolicy("abc", builder => { //App:CorsOrigins in appsettings.json can contain more than one address with split 阅读全文
posted @ 2020-08-19 14:06 IWing 阅读(43) 评论(0) 推荐(0) 编辑
摘要:services.AddControllers().AddJsonOptions(c => { c.JsonSerializerOptions.PropertyNamingPolicy = new NormalPolicy(); }); public class NormalPolicy : Jso 阅读全文
posted @ 2020-08-19 11:05 IWing 阅读(86) 评论(0) 推荐(0) 编辑
摘要:public override void OnActionExecuted(ActionExecutedContext context) { if (context.Exception != null && context.ExceptionHandled == false) { context.E 阅读全文
posted @ 2020-08-18 12:33 IWing 阅读(77) 评论(0) 推荐(0) 编辑
摘要:.net core 3.0后,获取IServiceProvider需要绕点弯路 首先,新建一个类: public class MyServiceProviderFactory : IServiceProviderFactory<IServiceProvider> { public IServiceP 阅读全文
posted @ 2020-08-14 20:38 IWing 阅读(370) 评论(0) 推荐(0) 编辑
摘要:这个 vs 2019的插件,可以快速把构造函数参数,赋给类的局部私有变量,提高写依赖注入的效率 示例:原始代码 public class TestClass { public TestClass(ILogger<TestClass> logger , IServiceProvider service 阅读全文
posted @ 2020-08-14 20:19 IWing 阅读(201) 评论(0) 推荐(0) 编辑
摘要:依赖注入 var connectionConfiguration = new ConnectionConfiguration { Hosts = new List<HostConfiguration> { new HostConfiguration { Host = hostName, Port = 阅读全文
posted @ 2020-08-13 11:45 IWing 阅读(104) 评论(0) 推荐(0) 编辑
摘要:nuget 引入: Serilog.Extensions.LoggingSerilog.Settings.ConfigurationSerilog.Sinks.ConsoleSerilog.Sinks.File 初始化代码: var log = new LoggerConfiguration() . 阅读全文
posted @ 2020-08-11 12:04 IWing 阅读(66) 评论(0) 推荐(0) 编辑
摘要:Frequency in hertz (semitones above or below middle C) Octave→Note↓0123456789 C 16.352 (−48) 32.703 (−36) 65.406 (−24) 130.81 (−12) 261.63 (0) 523.25 阅读全文
posted @ 2020-08-10 21:17 IWing 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-08-07 09:21 IWing 阅读(51) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页