Last active
April 3, 2019 11:26
-
-
Save ibrahimozgon/2854b753ac55902d4bb2353baec6083f 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
[Route("api/[controller]")] | |
[ApiController] | |
public class ProductsController : ControllerBase | |
{ | |
private readonly MyDbContext _context; | |
public ProductsController(MyDbContext context) | |
{ | |
_context = context; | |
} | |
// GET api/values | |
[HttpGet] | |
//1 | |
[EnableQuery] | |
public ActionResult<IQueryable<Product>> Get() | |
{ | |
return _context.Products; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment