GilliamII
GilliamII
Explore posts from servers
CC#
Created by GilliamII on 9/12/2023 in #help
❔ ✅ Swagger not sending Guid string correctly
thank you
9 replies
CC#
Created by GilliamII on 9/12/2023 in #help
❔ ✅ Swagger not sending Guid string correctly
[HttpGet]
[Route("{id:Guid}")]
public async Task<IActionResult> GetById ( [FromRoute] Guid Id )
{
var walkDomainModel = await walkRepository.GetByIdAsync(Id);
if (walkDomainModel == null)
{
return NotFound();
}

var walkDto = mapper.Map<WalkDto>(walkDomainModel);

return Ok(walkDto);
}
[HttpGet]
[Route("{id:Guid}")]
public async Task<IActionResult> GetById ( [FromRoute] Guid Id )
{
var walkDomainModel = await walkRepository.GetByIdAsync(Id);
if (walkDomainModel == null)
{
return NotFound();
}

var walkDto = mapper.Map<WalkDto>(walkDomainModel);

return Ok(walkDto);
}
9 replies