// GET: User public IActionResult Index() { var allUsers = _userRepository.GetAll(); List <ViewModels.User.CreateUserVM> usersviewmodel = new List <CreateUserVM>(); foreach (var userItem in allUsers) { UserProfile userProfile = new UserProfile() { AddedDate = userItem.UserProfile.AddedDate, Phone = userItem.UserProfile.Phone, Address = userItem.UserProfile.Address, FirstName = userItem.UserProfile.FirstName, Id = userItem.UserProfile.Id, IPAddress = userItem.UserProfile.IPAddress, LastName = userItem.UserProfile.LastName, ModifiedDate = userItem.UserProfile.ModifiedDate != null ? userItem.UserProfile.ModifiedDate : null, }; CreateUserVM tempUser = new CreateUserVM() { Address = userProfile.Address, Email = userItem.Email, FirstName = userProfile.FirstName, LastName = userProfile.LastName, Id = userItem.Id, Password = userItem.Password, Phone = userProfile.Phone, UserName = userItem.UserName }; usersviewmodel.Add(tempUser); } return(View(usersviewmodel)); }
public IEnumerable <User> GetUsers() { return(_userRepository.GetAll()); }