摘要:
AddAuthentication 认证 AddAuthorization 授权 一、Cookie认证 public void ConfigureServices(IServiceCollection services) { services.AddControllers(); //启动身份验证中间 阅读全文
摘要:
1.新建两个文件 public interface ICounter { int Get(); } public class Counter : ICounter { int i; public int Get() { return i++; } } 2.启动时注册 //单例模式 services. 阅读全文