public virtual async Task <IActionResult> Delete(int id) { try { ApplicationUser user = await _userManager.GetUserAsync(HttpContext.User); Participant deletedDto = await _participantService.DeleteAsync(id, user, ModelState.AddModelError); if (deletedDto == null) { return(BadRequest(ModelState)); } return(Ok(deletedDto)); } catch (EntityNotFoundException <Participant, int> ) { return(NotFound()); } }