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))); } }
public async Task <IEnumerable <CalendarEventModel> > GetAllEvents(string userId) { var entities = await _repository.GetAll(userId); return(Mapper.Map <IEnumerable <CalendarEventModel> >(entities)); }
public IEnumerable <Celebration> AllCelebrations() { return(_calendarRepository.GetAll(x => true).SelectMany(x => x.Celebrations)); }
public IEnumerable <CalendarOfEvents> GetAll() { return(_repository.GetAll()); }