摘要: Authentication(认证) WebAPI中的认证既可以使用HttpModel也可以使用HTTP message handler,具体使用哪个可以参考一下依据:一个HttpModel可以检测ASP.NET请求管道中的所有请求,一个message handler仅仅可以检测到被路由到这个Web... 阅读全文
posted @ 2015-04-27 17:48 senki 阅读(591) 评论(0) 推荐(0)
摘要: 如果没有对应的web api模板,首先使用nuget进行安装例子1:ProductController 是以硬编码的方式使用StoreAppContext类的实例,可以使用依赖注入模式,在外部指定上下文实例 1 public interface IStoreAppContext:IDisposa... 阅读全文
posted @ 2015-04-27 15:16 senki 阅读(309) 评论(0) 推荐(0)
摘要: 安装追踪用的包Install-Package Microsoft.AspNet.WebApi.TracingUpdate-Package Microsoft.AspNet.WebApi.WebHost //-Version指定具体的版本启用追踪的功能(在WebApiConfig.cs中)publ... 阅读全文
posted @ 2015-04-27 11:09 senki 阅读(567) 评论(0) 推荐(0)