public async Task <IActionResult> DeleteAsync(int id) { //EmployeeAttendence data delete by id var result = await _rankService.DeleteAsync(id); if (result == null) { return(BadRequest(result.Message)); } //show message return(Ok(result.Message)); }
public async Task <IActionResult> Delete(string id, [FromForm] RankDeleteModel deleteModel) { try { var isEffected = await _rankService.DeleteAsync(id, deleteModel); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public async Task <ActionResult> DeleteAsync(int id) { try { await rankService.DeleteAsync(new RankDTO { Id = id }); } catch (NotFoundException e) { return(NotFound(new { Id = id, e.Message })); } catch (DeleteNotPermittedException e) { return(Conflict(e.Message)); } return(NoContent()); }