Created
October 31, 2017 20:29
-
-
Save fatihdgn/94f8bfd157aa07193e02a95d696a4b3d to your computer and use it in GitHub Desktop.
This file contains 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
using Models; | |
using Providers; | |
public class CategoryController : ApiController | |
{ | |
[ResponseType(typeof(List<Category>))] | |
public IHttpActionResult Get() => Ok(CategoryProvider.Categories); | |
[ResponseType(typeof(Category))] | |
public IHttpActionResult Get(string id) => Ok(CategoryProvider.Categories.FirstOrDefault(x => x.Id == id)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment