public async Task <Person> GetRecipientAsync( [Parent] Message message, PersonByIdDataLoader personById, CancellationToken cancellationToken) { return(await personById.LoadAsync(message.RecipientId, cancellationToken)); }
public async Task <Person> GetSenderAsync( [Parent] Message message, PersonByIdDataLoader personById, CancellationToken cancellationToken) { return(await personById.LoadAsync( message.SenderId, cancellationToken) .ConfigureAwait(false)); }
public async Task <Person> GetPersonAsync( MediaFace face, PersonByIdDataLoader dataLoader, CancellationToken cancellationToken) { if (face.PersonId.HasValue) { return(await dataLoader.LoadAsync(face.PersonId.Value, cancellationToken)); } return(null); }
public Task <IReadOnlyList <Person> > GetPersonsAsync( [ID(nameof(Person))] int[] ids, PersonByIdDataLoader dataLoader, CancellationToken cancellationToken) => dataLoader.LoadAsync(ids, cancellationToken);
public Task <Person> GetPersonAsync( [ID(nameof(Person))] int id, PersonByIdDataLoader dataLoader, CancellationToken cancellationToken) => dataLoader.LoadAsync(id, cancellationToken);