コード例 #1
0
 public IEnumerable <AbsenceRequestDto> GetAbsenceRequests()
 {
     if (this.User.IsInRole(SeedData.AdminRole))
     {
         return(_mapper.Map <IEnumerable <AbsenceRequestDto> >(_repo.GetAll(null)));
     }
     else
     {
         var currentUserId = GetCurrentUserId();
         return(_mapper.Map <IEnumerable <AbsenceRequestDto> >(_repo.GetAll(req => req.UserId == currentUserId)));
     }
 }
コード例 #2
0
        public async Task <IEnumerable <CalendarEventModel> > GetAllEvents(string userId)
        {
            var entities = await _repository.GetAll(userId);

            return(Mapper.Map <IEnumerable <CalendarEventModel> >(entities));
        }
コード例 #3
0
 public IEnumerable <Celebration> AllCelebrations()
 {
     return(_calendarRepository.GetAll(x => true).SelectMany(x => x.Celebrations));
 }
コード例 #4
0
 public IEnumerable <CalendarOfEvents> GetAll()
 {
     return(_repository.GetAll());
 }