Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

TechnologiesController.cs 715B

1234567891011121314151617181920212223
  1. namespace Diligent.WebAPI.Host.Controllers.V1
  2. {
  3. [ApiVersion("1.0")]
  4. [Route("v{version:apiVersion}/technologies")]
  5. [ApiController]
  6. public class TechnologiesController : ControllerBase
  7. {
  8. private readonly ITechnologyService _technologyService;
  9. public TechnologiesController(ITechnologyService technologyService)
  10. {
  11. _technologyService = technologyService;
  12. }
  13. [HttpGet]
  14. public async Task<IActionResult> GetAll() =>
  15. Ok(await _technologyService.GetAllAsync());
  16. [HttpGet("{id}")]
  17. public async Task<IActionResult> GetById([FromRoute] int id) =>
  18. Ok(await _technologyService.GetByIdAsync(id));
  19. }
  20. }