
asp
夏天的波波
这个作者很懒,什么都没留下…
展开
-
依赖注入2 优势 生命周期
model创建StudentDB类public class StudentDB : IStudentRepository { public Student Add(Student student) { throw new NotImplementedException(); } public Student GetStudent(int id) { Student s原创 2021-04-04 21:10:50 · 122 阅读 · 0 评论 -
ASP.NET查询的实现
Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddMvc(); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) {原创 2021-04-04 20:19:29 · 429 阅读 · 0 评论 -
依赖注入
Model创建IStudentRepository public interface IStudentRepository//加public,默认私有 { public Student Add(Student student); public Student GetStudent(int id); }StudentRepository下 public class StudentRepository:IStudentRepository//继承 {原创 2021-04-04 20:19:11 · 81 阅读 · 0 评论 -
ASP.NET打开网页
打开静态文件,打开默认静态文件,打开自己设置的静态文件 public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } //默认打开网页自己设置原创 2021-04-04 12:19:24 · 316 阅读 · 0 评论 -
ASP.NET Core 中间件 请求处理管道
加载顺序:appsetting.json–》appsetting.envorament.json–》user secret–》环境变量–》command line原创 2021-04-04 11:24:14 · 145 阅读 · 0 评论