public async Task <IEnumerable <Attendee> > GetAttendeesAsync(Session session, [ScopedService] ApplicationDbContext dbContext, AttendeeByIdDataLoader attendeeByIdDataLoader, CancellationToken cancellationToken) { var speakerIds = await dbContext.Sessions .Where(s => s.Id == session.Id) .Include(s => s.SessionSpeakers) .SelectMany(s => s.SessionSpeakers.Select(t => t.SpeakerId)) .ToArrayAsync(cancellationToken); return(await attendeeByIdDataLoader.LoadAsync(speakerIds, cancellationToken)); }
public async Task <IEnumerable <Attendee> > GetAttendeesAsync( [Parent] Session session, [ScopedService] ApplicationDbContext dbContext, AttendeeByIdDataLoader attendeeById, CancellationToken cancellationToken) { int[] attendeeIds = await dbContext.Sessions .Where(s => s.Id == session.Id) .Include(s => s.SessionAttendees) .SelectMany(s => s.SessionAttendees.Select(t => t.AttendeeId)) .ToArrayAsync(cancellationToken); return(await attendeeById.LoadAsync(attendeeIds, cancellationToken)); }
public Task <Attendee> GetAttendeeAsync( AttendeeByIdDataLoader attendeeById, CancellationToken cancellationToken) => attendeeById.LoadAsync(AttendeeId, cancellationToken);
public async Task <IEnumerable <Attendee> > GetAttendeeByIdAsync( [ID(nameof(Attendee))] int[] ids, AttendeeByIdDataLoader attendeeById, CancellationToken cancellationToken) => await attendeeById.LoadAsync(ids, cancellationToken);
public Task <Attendee> GetAttendeeByIdAsync( [ID(nameof(Attendee))] int id, AttendeeByIdDataLoader attendeeById, CancellationToken cancellationToken) => attendeeById.LoadAsync(id, cancellationToken);