예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public IEnumerable <UserAward> GetAll()
 {
     return(_userAwardDAO.GetAll());
 }