Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public class WebApiApplication : System.Web.HttpApplication
  2. {
  3. protected void Application_Start()
  4. {
  5. GlobalConfiguration.Configure(WebApiConfig.Register);
  6. }
  7. }
  8.  
  9. public static class WebApiConfig
  10. {
  11. public static void Register(HttpConfiguration config)
  12. {
  13. config.MapHttpAttributeRoutes();
  14.  
  15. config.Routes.MapHttpRoute(
  16. name: "DefaultApi",
  17. routeTemplate: "api/{controller}/{id}",
  18. defaults: new { id = RouteParameter.Optional }
  19. );
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement