摘要:
使用XML文件来动态配置ASP.NET MVC的Route规则一般情况下,我们都是直接在Global.asax.cs文件中直接写上Route规则的,例如:public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{contr... 阅读全文
摘要:
5.2 Sending HTML Form Data5.2 发送HTML表单数据本文引自:http://www.asp.net/web-api/overview/working-with-http/sending-html-form-data,-part-1By Mike Wasson|June 15, 2012作者:Mike Wasson | 日期:2012-6-15Part 1: Form-urlencoded Data第1部分:URL编码的表单数据This article shows how to post form-urlencoded data to a Web API contro 阅读全文
摘要:
依赖注入与 MVC 类似, Web API 提供了System.Web.Http.Services.IDependencyResolver 接口来实现依赖注入, 我们可以很容易的用 Unity 来实现这个接口:?12345678910111213141516171819public class UnityDependencyResolver : IDependencyResolver { private readonly IUnityContainer _container; public UnityDependencyResolver(IUnityContainer container) { 阅读全文