随笔分类 -  DotNETCore

摘要:.NET Core was released a few months ago, and data access libraries for most databases, both relational and NoSQL are now available. In this post, I’ll 阅读全文
posted @ 2016-11-22 16:43 自然去留 阅读(1054) 评论(0) 推荐(0)
摘要:APIDescriptionRequest bodyResponse body GET /api/todo Get all to-do items None Array of to-do items GET /api/todo/{id} Get an item by ID None To-do it 阅读全文
posted @ 2016-08-01 09:56 自然去留 阅读(353) 评论(0) 推荐(0)
摘要:Razor Syntax Reference Implicit Razor expressions @DateTime.Now @DateTime.IsLeapYear(2016) @await DoSomething("hello", "world") Explicit Razor expressions Last week this time: @(DateTime.Now - TimeS... 阅读全文
posted @ 2016-07-14 09:29 自然去留 阅读(452) 评论(0) 推荐(0)
摘要:Open Web Interface for .NET (OWIN) ------------------------------------------------------------------------- Running OWIN middleware in the ASP.NET pipeline "dependencies": { "Microsoft.AspNetCo... 阅读全文
posted @ 2016-07-08 10:48 自然去留 阅读(689) 评论(0) 推荐(0)
摘要:Servers ASP.NET Core ships with two different HTTP servers: •Microsoft.AspNetCore.Server.Kestrel (AKA Kestrel, cross-platform) •Microsoft.AspNetCore.Server.WebListener (AKA WebListener, Windows-onl... 阅读全文
posted @ 2016-06-30 10:42 自然去留 阅读(293) 评论(0) 推荐(0)
摘要:Application State Options --------------------------------------------------------------------- *HttpContext.Items app.Use(async (context, next) => { // perform some verification context.Item... 阅读全文
posted @ 2016-06-18 10:35 自然去留 阅读(243) 评论(0) 推荐(0)
摘要:Model Binding Below is a list of model binding attributes: •[BindRequired]: This attribute adds a model state error if binding cannot occur. •[BindNever]: Tells the model binder to never bind to thi... 阅读全文
posted @ 2016-06-14 09:47 自然去留 阅读(275) 评论(0) 推荐(0)
摘要:Hosting -------------------------------------------------------------------------- Setting up a Host : using Microsoft.AspNetCore.Hosting; public class Program { public static void Ma... 阅读全文
posted @ 2016-05-20 14:49 自然去留 阅读(380) 评论(0) 推荐(0)
摘要:Dependency Injection ------------------------------------------------------------------------ ASP.NET services can be configured with the following lifetimes: Transient Transient lifetime services a... 阅读全文
posted @ 2016-05-16 14:19 自然去留 阅读(303) 评论(0) 推荐(0)
摘要:Configuration var builder = new ConfigurationBuilder(); builder.AddInMemoryCollection(); var config = builder.Build(); config["somekey"] = "somevalue"; // do some other work var setting = config["... 阅读全文
posted @ 2016-05-15 13:50 自然去留 阅读(302) 评论(0) 推荐(0)
摘要:Logging --------------------------------------------------------------------------------------- Implementing Logging in your Application var logger = loggerFactory.CreateLogger("Catchall Endpoint");... 阅读全文
posted @ 2016-05-14 14:02 自然去留 阅读(502) 评论(0) 推荐(0)
摘要:Globalization and localization **************************************************************************************************** using Microsoft.AspNet.Localization; using Microsoft.AspNet.Mvc.Loc... 阅读全文
posted @ 2016-05-12 11:41 自然去留 阅读(872) 评论(0) 推荐(1)
摘要:Error Handling public void Configure(IApplicationBuilder app, IHostingEnvironment env) { app.UseIISPlatformHandler(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPa... 阅读全文
posted @ 2016-05-07 11:23 自然去留 阅读(302) 评论(0) 推荐(0)
摘要:Route ------------------------------------------constraint---------------------------------------------------- routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{i... 阅读全文
posted @ 2016-05-05 11:09 自然去留 阅读(635) 评论(0) 推荐(0)
摘要:Application Startup Startup Constructor - IHostingEnvironment - ILoggerFactory ConfigureServices - IServiceCollection Configure - IApplicationBuilder - IHostingEnvironment - ILoggerFactory ------... 阅读全文
posted @ 2016-04-06 10:50 自然去留 阅读(1085) 评论(0) 推荐(0)