daily pastebin goal
62%
SHARE
TWEET

AttributeRouting

CryptoJones Oct 20th, 2016 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System.Collections.Generic;
  2. using System.Web.Http;
  3.  
  4. namespace ReinkeAppsApi.Controllers
  5. {
  6.     [RoutePrefix("v1/quote")]
  7.     public class QuoteV1Controller : ApiController
  8.     {
  9.         [RequireHttps]
  10.         [Route("v1/quote/get")]
  11.         public IEnumerable<string> Get()
  12.         {
  13.             return new string[] { "I\'ve just picked up a fault in the AE35 unit. It\'s going to go 100% failure in 72 hours." };
  14.         }
  15.  
  16.         [RequireHttps]
  17.         [Route("v1/quote/post")]
  18.         public void Post([FromBody]string value)
  19.         {
  20.             int i = 1;
  21.             i++;
  22.         }
  23.  
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top