/MvcApplicationAPI/App_Start/WebApiConfig.cs

https://github.com/henrikjakobsen/WebAPI · C# · 25 lines · 20 code · 3 blank · 2 comment · 0 complexity · 72c3b71ce78fa41fb1a90a67f7089561 MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web.Http;
  5. namespace MvcApplicationAPI
  6. {
  7. public static class WebApiConfig
  8. {
  9. public static void Register(HttpConfiguration config)
  10. {
  11. config.Routes.MapHttpRoute(
  12. name: "DefaultApi",
  13. routeTemplate: "api/{controller}/{id}",
  14. defaults: new { id = RouteParameter.Optional }
  15. );
  16. config.EnableQuerySupport();
  17. // To disable tracing in your application, please comment out or remove the following line of code
  18. // For more information, refer to: http://www.asp.net/web-api
  19. TraceConfig.Register(config);
  20. }
  21. }
  22. }