You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CategoriesController.cs 603B

123456789101112131415161718192021
  1. using Microsoft.AspNetCore.Mvc;
  2. namespace Diligent.WebAPI.Host.Controllers.V1
  3. {
  4. [ApiVersion("1.0")]
  5. [Route("v{version:apiVersion}/categories")]
  6. [ApiController]
  7. public class CategoriesController : ControllerBase
  8. {
  9. private readonly ICategoryService _categoryService;
  10. public CategoriesController(ICategoryService categoryService)
  11. {
  12. _categoryService = categoryService;
  13. }
  14. [HttpGet("names")]
  15. public async Task<IActionResult> GetCategoriesNames() =>
  16. Ok(await _categoryService.GetCategoriesNamesAsync());
  17. }
  18. }