public IEnumerable <SessionInfo> GetItems(int codeCampId) { var items = repo.GetItems(codeCampId); items.Select(s => { s.RegistrantCount = GetRegistrantCount(s.SessionId); return(s); }); foreach (var item in items) { item.Speakers = speakerRepo.GetSpeakersForCollection(item.SessionId, item.CodeCampId); } return(items); }
private List <SessionInfo> GetSessionsForSpeaker(int codeCampId, int speakerId) { var allSessions = sessionRepo.GetItems(codeCampId); var sessionSpeakers = sessionSpeakerRepo.GetItemsBySpeakerId(speakerId).Select(s => s.SessionId); var sessions = allSessions.Where(s => sessionSpeakers.Contains(s.SessionId)); return(sessions.ToList()); }