public async Task <IActionResult> GetSaleById([FromRoute] int id) { var result = await saleService.GetByIdAsync(id); if (result == null) { return(BadRequest(new { Message = "The requested sale does not exist." })); } return(Ok(saleService.ConvertToDto(result))); }