public async Task <IActionResult> Delete([FromRoute] int reportId) { var reportToDelete = await _reportsRepository.FindByIdAsync(reportId); var deleted = await _reportsRepository.DeleteAsync(reportToDelete); if (deleted) { return(NoContent()); } return(NotFound(new { Error = "Report was not found." })); }