public void DisplayAllUsers() { var users = _bll.GetAllUsers(); Console.WriteLine("Сохраненные пользователи:" + Environment.NewLine); foreach (Users item in users) { Console.WriteLine(string.Format("Имя: {0}, Дата рождения: {1}, Возраст: {2}", item.Name, item.DateOfBirth, item.Age)); } }
public void DisplayUsers() { Console.WriteLine("USERS:::"); Console.WriteLine("ID \t\t\t\t\t NAME \t AGE"); foreach (User u in _userLogic.GetAllUsers()) { Console.WriteLine($"{u.ID} \t {u.Name} \t {u.Age} "); } }
public HttpResponseMessage GetUsers() { try { List <UserDTO> _Output = _IUserBLL.GetAllUsers().ToList(); return(Request.CreateResponse(HttpStatusCode.OK, _Output)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
public IActionResult Get() { return(Ok(_userBll.GetAllUsers().Select(user => _mapper.Map <UserViewModel>(user)))); }
public ActionResult <IEnumerable <UserModel> > GetAllUsers() { return(_userBLL.GetAllUsers().Select(m => m.ToModel()).ToArray()); }
public static UserListViewModel Create(IUserBLL userBLL, IRepository<Project> projectRepository, int? filterProjectId) { var users = filterProjectId == null ? userBLL.GetAllUsers() : userBLL.GetAllUsers().Where(x => x.Projects.Contains(projectRepository.GetById(filterProjectId.Value))); var viewModel = new UserListViewModel { Users = users.ToList(), Projects = userBLL.GetAllProjectsByUser(projectRepository).ToList(), SelectedFilterProjectId = filterProjectId }; return viewModel; }
public List <UserModelResponse> GetAllUsers() { return(userBLL.GetAllUsers()); }