public Award GetByID(Guid id) { var award = _awardDAO.GetByID(id); var usersId = _userAwardDAO.GetAll().Where(p => p.IdAward == id).Select(p => p.IdUser); foreach (var user in _userDAO.GetAll()) { foreach (var userId in usersId) { if (userId == user.ID) { award.Users.Add(user); } } } return(award); }
public User GetByID(Guid id) { var user = _userDAO.GetByID(id); var awardsId = _userAwardDAO.GetAll().Where(p => p.IdUser == id).Select(p => p.IdAward); foreach (var award in _awardDAO.GetAll()) { foreach (var awardId in awardsId) { if (awardId == award.ID) { user.Awards.Add(award); } } } return(user); }
public IEnumerable <UserAward> GetAll() { return(_userAwardDAO.GetAll()); }