Files
FA_WEB/FaKrosnoApi/Controllers/WzClientController.cs

24 lines
655 B
C#

using Microsoft.AspNetCore.Mvc;
using SytelineSaAppEfDataModel.Dtos;
using SytelineSaAppEfDataModel.Services;
namespace FaKrosnoApi.Controllers;
[ApiController]
[Route("api/[controller]")]
public class WzClientController(IWzClientService service) : Controller
{
[HttpGet]
public async Task<ActionResult<IEnumerable<WzClientDto>>> GetAll()
{
IEnumerable<WzClientDto> wzClients = await service.GetAll();
return Ok(wzClients);
}
[HttpGet("by-id")]
public async Task<ActionResult<WzClientDto>> GetById(Guid id)
{
WzClientDto? wzClient = await service.GetById(id);
return Ok(wzClient);
}
}