Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Last active October 19, 2017 01:43
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 HamidMosalla/1afc1fbadbdb8ef1eab87cd906725759 to your computer and use it in GitHub Desktop.
Save HamidMosalla/1afc1fbadbdb8ef1eab87cd906725759 to your computer and use it in GitHub Desktop.
[Produces("application/json")]
[Route("api/Product")]
public class ProductApiController : Controller
{
public OkObjectResult Get()
{
var products = new { Products = new[] { new { Id = 1, Name = "Normal Bear" }, new { Id = 2, Name = "Panda Bearer" }, new { Id = 3, Name = "JWT Bearer" } } };
return Ok(products);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment