摘要: 中间件简介 ASP.NET Core 由很多中间件构成,实现了一个HTTP请求管道(pipeline)。 Request的Response的管道可以看成一个Push Stack 和 Pop Stack。 在Startup.cs的Configure方法中配置中间件。 实现一个中间件 1. 构造函数Re 阅读全文
posted @ 2016-08-10 15:48 _DN 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 静态资源包括HTML,CSS,图片和Js文件。在ASP.NET Core 1.0中,静态资源默认的所在目录是wwwroot,wwwroot可以在project.json中定义。 Steps: 1. 在wwwroot下面添加静态资源; 2. Startup的Config里面配置:app.UseStat 阅读全文
posted @ 2016-08-10 15:07 _DN 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Transient – A new instance of the service is created each time it is requested. It can be used for stateless and light weight services. 可以理解为每次都要创建,主要 阅读全文
posted @ 2016-08-10 14:08 _DN 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 创建一个ASP.NET Core MVC项目的时候,会产生一个bower.json的文件,用于管理前段的js. NPM & Bower NPM主要运用于Node.js项目的内部依赖包管理,安装的模块位于项目根目录下的node_modules文件夹内 而Bower大部分情况下用于前端开发,对于CSS/ 阅读全文
posted @ 2016-08-10 11:40 _DN 阅读(319) 评论(0) 推荐(0) 编辑
摘要: Cross platform support and flexible runtime engine(跨平台支持和灵活的运行时引擎) ASP.NET Core 1.0 offers support for cross platform and this is seen to be an exciti 阅读全文
posted @ 2016-08-10 10:30 _DN 阅读(175) 评论(0) 推荐(0) 编辑
摘要: View injection is the most useful feature introduced in ASP.NET Core. 1.添加一个FruitsService 2.Inject in View 基本语法: @inject 为DI的指令 待注入服务的名称 服务的名字,代表一个服务的 阅读全文
posted @ 2016-08-10 09:48 _DN 阅读(418) 评论(0) 推荐(0) 编辑