摘要: AddAuthentication 认证 AddAuthorization 授权 一、Cookie认证 public void ConfigureServices(IServiceCollection services) { services.AddControllers(); //启动身份验证中间 阅读全文
posted @ 2020-05-30 13:58 富坚老贼 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 1.新建两个文件 public interface ICounter { int Get(); } public class Counter : ICounter { int i; public int Get() { return i++; } } 2.启动时注册 //单例模式 services. 阅读全文
posted @ 2020-05-30 11:44 富坚老贼 阅读(86) 评论(0) 推荐(0) 编辑