Пример #1
0
        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." }));
        }