public async Task <IActionResult> GetImageById([FromRoute][ValidateGuid] string imageId) { var image = await _imagesService.GetByIdAsync(imageId); if (image == null) { var error = new ApiError("Image with such Id was not found.", HttpStatusCode.NotFound); return(NotFound(error)); } return(Ok(image)); }
public async Task <ActionResult <ImageDto> > Get([FromRoute] int id) { var response = await _imagesService.GetByIdAsync(id); return(Ok(response)); }