// GET: DesignationMasterController/Edit/5 public ActionResult Edit(int id) { var designationInfo = _designationMasterService.GetDesignationbyIdAsync(id); if (designationInfo == null) { return(RedirectToAction("List")); } var viewModel = new DesignationMasterModel { Id = designationInfo.Id, Designation = designationInfo.Designation, Active = Convert.ToBoolean(designationInfo.Active), ContinueEditing = IsContinueEditingAllowed() }; return(View(viewModel)); }
public async Task <IActionResult> List() { var userList = await _userMasterService.GetAllUsers(); var model = userList.Select(u => new UserMasterModel { Id = u.Id, FirstName = u.FirstName, LastName = u.LastName, Email = u.EmailId, Designation = _designationMasterService.GetDesignationbyIdAsync(u.DesignationId).Designation, ContactNumber = u.ContactNumber }).ToList(); return(View(model)); }