public ActionResult ManageUser() { List <User> list = userDetails.GetUserDetails(); List <UserViewModel> userList = new List <UserViewModel>(); foreach (User detail in list) { UserViewModel userViewModel = new UserViewModel { UserId = detail.UserId, FirstName = detail.FirstName, LastName = detail.LastName, MobileNumber = detail.MobileNumber, Gmail = detail.Gmail, Password = detail.Password, UserType = detail.UserType }; userList.Add(userViewModel); } return(View(userList)); }