public async Task <IActionResult> RemoveConsultant(Guid id) { try { if (ModelState.IsValid) { var result = await consultantService.DeleteConsultant(id); if (result == DbStatusCode.Deleted) { return(Ok()); } else if (result == DbStatusCode.NotFound) { return(StatusCode(404)); } else if (result == DbStatusCode.Exception) { return(StatusCode(500)); } else { return(Forbid()); } } else { return(BadRequest(ModelState)); } } catch (Exception ex) { return(BadRequest(ex.Message ?? ex.InnerException.Message)); } }
public async Task <IActionResult> DeleteConsultant(int id) { await _consultantService.DeleteConsultant(id); return(Ok()); }