Example #1
0
        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);
        }
Example #2
0
        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);
        }