Last active
December 20, 2015 05:19
-
-
Save jayhjkwon/6077757 to your computer and use it in GitHub Desktop.
WebAPI attribute routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RoutePrefix("api/books")] | |
public class BooksController : ApiController | |
{ | |
// GET api/books | |
[Route("")] | |
public IEnumerable<Book> Get() { ... } | |
// GET api/books/5 | |
[Route("{id:int}")] | |
public Book Get(int id) { ... } | |
// POST api/books | |
[Route("")] | |
public HttpResponseMessage Post(Book book) { ... } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
config.MapHttpAttributeRoutes(); | |
} | |
} |
test
test
test
test
test
test
test
test
test
test
Hello
안녕
test
test
test
11111
test
1393939dddjfdfnadsfjdsnfdvdvnsdvjdijvdnvlsdvjsdvmsdoivjsdgvevidevnlvsdoivjdnveajfdsnfajoifjewjfsjfsdanvoijei
This is awesome, great
test
test
test2
test
test
test
bower install autogrow-textarea
Hello,This is really awesome, great !!
Hello,This is really awesome, great !!
test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello