예제 #1
0
        // 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));
        }
예제 #2
0
 public IEnumerable <User> GetUsers()
 {
     return(_userRepository.GetAll());
 }