示例#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);
示例#2
0
 public static IQueryable <Conference> GetAllConferences(this ConferenceContext context) =>
 context.Conferences
 .Include(c => c.Sessions)
 .ThenInclude(s => s.Attendees);
示例#3
0
 public static bool ThereIsNoConferenceWithGivenName(this ConferenceContext context, string name) =>
 context.Conferences.Count(c => c.Name == name) == 0;
示例#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);