摘要: 1,nuget Swashbuckle.AspNetCore 2,Startup.cs 中方法: ConfigureServices 添加代码 services.AddSwaggerGen();//注册 Swagger 3,Startup.cs 中方法:Configure 添加代码 app.UseS 阅读全文
posted @ 2021-01-27 16:35 Lin_pin 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 一,全局限制 Startup.cs 中 ConfigureServices 方法中添加 services.Configure<FormOptions>(options => { options.MultipartBodyLengthLimit = 50000; }); 二,单页面限制 service 阅读全文
posted @ 2021-01-27 16:20 Lin_pin 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 一,ActionFilterAttribute 1 public class CustomActionFilterAttribute: ActionFilterAttribute 2 { 3 public override void OnActionExecuting(ActionExecuting 阅读全文
posted @ 2021-01-27 15:54 Lin_pin 阅读(144) 评论(0) 推荐(0) 编辑
摘要: C#9.0 //对象声明 Person person1 = new ("111", "222");//语法糖 //静态修饰 Func<int> func = static () => 1; //为空判断 if (name is not null) { } //模式运算 Func<char, Bool 阅读全文
posted @ 2021-01-27 14:34 Lin_pin 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Asp.Net.Core5 内置IOC容器 一,IServiceCollection 依赖注入 仅支持构造函数注入 1,在Startup.cs 中 ConfigureServices方法注入服务 services.AddTransient<Interfaces.IUser, Services.Use 阅读全文
posted @ 2021-01-27 10:53 Lin_pin 阅读(474) 评论(0) 推荐(0) 编辑