GetAllCategories.cs 493 B

123456789101112131415161718
  1. using ApiMobileBelov.BaseConnection;
  2. using Microsoft.AspNetCore.Mvc;
  3. namespace ApiMobileBelov.Controllers
  4. {
  5. [Route("api/[controller]")]
  6. [ApiController]
  7. [ApiExplorerSettings(GroupName = "Категории тренировок")]
  8. public class GetAllCategories : ControllerBase
  9. {
  10. ApplicationContext db = new ApplicationContext();
  11. [HttpGet]
  12. public IActionResult Index()
  13. {
  14. return Ok(db.tableCategory.ToList());
  15. }
  16. }
  17. }