public bool GetUsersData(out List <UserData> usersData, out string errorString) { usersData = null; errorString = string.Empty; IUsersDataManager usersDataMan = managersFactory.CreateUsersDataManagerr(); if (usersDataMan == null) { errorString = "Failed retrieving UsersDataManager"; return(false); } List <User> users = null; if (!usersDataMan.GetUsers(out users, out errorString)) { return(false); } usersData = new List <UserData>(); foreach (User user in users) { UserData userData = new UserData(); userData.ID = user.UserId; userData.Name = user.Name; usersData.Add(userData); } return(true); }
public async Task <CustomResponse <GetUsersModel> > GetUserList(GetUserModel model) { var user = await _userManager.FindByEmailAsync(model.Email); var users = _usersDataManager.GetUsers(new GetUserModel() { UserId = user.Id }); return(new CustomResponse <GetUsersModel> { Succeed = true, Data = users }); }