Beispiel #1
0
        public IEnumerable <Award> GetAll()
        {
            var cacheResult = _cacheLogic.Get <IEnumerable <Award> >(ALL_AWARDS_CACHE_KEY);

            if (cacheResult == null)
            {
                var result = _awardDAO.GetAll();
                _cacheLogic.Add(ALL_AWARDS_CACHE_KEY, _awardDAO.GetAll());
                return(result);
            }
            return(cacheResult);
        }
Beispiel #2
0
 public IEnumerable <Award> GetAll()
 {
     foreach (var award in _awardDAO.GetAll())
     {
         yield return(GetByID(award.ID));
     }
 }
Beispiel #3
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);
        }
Beispiel #4
0
 public IEnumerable <Award> GetAll()
 {
     return(_awardDao.GetAll());
 }
Beispiel #5
0
        public IEnumerable <Award> GetAll()
        {
            var result = _awardDAO.GetAll();

            return(result);
        }