internal object getSessionById(int id) { var session = _context.Sessions.Include("Rooms") .Include("Assignees") .Include("Speakers") .Include("ProctorCheckIns") .FirstOrDefault(s => s.Id == id); SessionDto sessionDto = MapToDto.MapSessionToDto(session); return(sessionDto); }
internal IList <SessionDto> getSessions() { List <SessionDto> sessionsDto = new List <SessionDto>(); var sessions = _context.Sessions .Include("Rooms") .Include("Assignees") .Include("ProctorCheckIns") .ToList(); foreach (var session in sessions) { SessionDto sessionDto = MapToDto.MapSessionToDto(session); sessionsDto.Add(sessionDto); } return(sessionsDto); }