Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // api/Custom/SayHello
  2. [HttpGet]
  3. public async Task<string> SayHello()
  4. {
  5.  
  6. return await Task.FromResult("Hello World Async").ConfigureAwait(false);
  7. }
  8.  
  9. // api/Custom/SayFloat
  10. [HttpGet]
  11. public async Task<float> SayFloat()
  12. {
  13.  
  14. return await Task.FromResult(1000.0f).ConfigureAwait(false);
  15. }
  16.  
  17. config.Routes.MapHttpRoute("DefaultApiWithId",
  18. "Api/{controller}/{id}",
  19. new { id = RouteParameter.Optional });
  20.  
  21. /* ----- this is trying to match my utility controller and its actions ----- */
  22. config.Routes.MapHttpRoute(
  23. name: "ActionApi",
  24. routeTemplate: "Api/{controller}/{action}"
  25. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement