private List<UserViewEnity> GetAllUsers() { var userRepository = new UserRepository(); List<UserViewEnity> usersList = new List<UserViewEnity>(); var users = userRepository.GetUsersByProviderId(int.Parse(Session["ProviderId"].ToString())); foreach (var user in users) { usersList.Add(new UserViewEnity { UserId = user.UserId, UserName = user.UserName }); } return usersList; }