// GET: LeaveAllocation/Details/5 public async Task <ActionResult> Details(string id) { var employee = _mapper.Map <Employee, EmployeeVM>(await _userManager.FindByIdAsync(id)); var allocations = _mapper.Map <ICollection <LeaveAllocation>, List <LeaveAllocationVM> >(await _leaveallocationrepo.GetLeaveAllocationsByEmployee(employee.Id)); var model = new ViewLeaveAllocationVM { Employee = employee, LeaveAllocation = allocations }; return(View(model)); }
// GET: LeaveAllocationsController/Details/5 public ActionResult Details(string id) { var employee = _mapper.Map <EmployeeVM>(_userManager.FindByIdAsync(id).Result); var allocation = _mapper.Map <List <LeaveAllocationVM> >(_leaveallocationrepo.GetLeaveAllocationsByEmployee(id)); var model = new ViewLeaveAllocationVM { Employee = employee, LeaveAllocations = allocation }; return(View(model)); }