public async Task <ActionResult> Details(int id) { if (!await repo.IsExistAsync(id)) { return(RedirectToAction(nameof(Index))); } var entity = await repo.GetAsync(id).ConfigureAwait(false); var model = mapper.Map <LeaveTypeViewModel>(entity); return(View(model)); }