Beispiel #1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _taskStatusService.DeleteAsync(id);

                return(Ok());
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }
Beispiel #2
0
 public async Task <IActionResult> Delete(int id)
 {
     return(await DeleteAsync(
                async() => await _taskStatusService.TaskStatusExistsAsync(id),
                async() => await _taskStatusService.DeleteAsync(id)));
 }