Exemplo n.º 1
0
 public static Conference GetByName(this ConferenceContext context, string name) =>
 context.Conferences
 .Include(c => c.Sessions)
 .ThenInclude(s => s.Attendees)
 .FirstOrDefault(c => c.Name == name);
Exemplo n.º 2
0
 public static IQueryable <Conference> GetAllConferences(this ConferenceContext context) =>
 context.Conferences
 .Include(c => c.Sessions)
 .ThenInclude(s => s.Attendees);
Exemplo n.º 3
0
 public static bool ThereIsNoConferenceWithGivenName(this ConferenceContext context, string name) =>
 context.Conferences.Count(c => c.Name == name) == 0;
Exemplo n.º 4
0
 public static Conference GetById(this ConferenceContext context, int conferenceId) =>
 context.Conferences
 .Include(c => c.Sessions)
 .ThenInclude(s => s.Attendees)
 .FirstOrDefault(c => c.Id == conferenceId);