public async Task <IActionResult> Delete(int id) { var statusCode = await _facultyService.DeleteAsync(id); var response = _facultyResponseComposer.ComposeForDelete(statusCode); return(response); }
public async Task <IActionResult> DeleteAsync(int id) { var result = await facultyService.DeleteAsync(id); if (!result.Success) { return(BadRequest(result)); } return(Ok(result)); }
public async Task <IActionResult> DeleteAsync(int facultyId) { var result = await _facultyService.DeleteAsync(facultyId); if (!result.Success) { return(BadRequest(result.Message)); } var facultyResource = _mapper.Map <Faculty, FacultyResource>(result.Resource); return(Ok(facultyResource)); }
public async Task <IActionResult> Delete(int id) { try { var entity = _service.DeleteAsync(id); return(Ok()); } catch (Exception) { return(BadRequest()); } }
public async Task <IActionResult> DeleteFaculty([FromRoute] int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } bool isSuccess = await _facultyService.DeleteAsync(id); if (!isSuccess) { return(NotFound()); } return(Ok()); }
public async Task <IActionResult> DeleteAsync(string IdFaculty) { var result = await _faculty.DeleteAsync(IdFaculty); return(Ok(result)); }