Skip to content

Instantly share code, notes, and snippets.

@fatihdgn
Created October 31, 2017 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatihdgn/94f8bfd157aa07193e02a95d696a4b3d to your computer and use it in GitHub Desktop.
Save fatihdgn/94f8bfd157aa07193e02a95d696a4b3d to your computer and use it in GitHub Desktop.
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