Example #1
0
            public async Task <IEnumerable <AttrDescr> > GetSessionsAsync(EntityBase attendee, [ScopedService] ApplicationDbContext dbContext,
                                                                          AttrDescrByIdDataLoader attrDescrByIdDataLoader, CancellationToken cancellationToken)
            {
                var attrDescrIds = await dbContext.AttrDescrs
                                   .Where(a => a.Id == attendee.Id)
                                   .Select(a => a.Id)
                                   .ToArrayAsync(cancellationToken: cancellationToken);

                return(await attrDescrByIdDataLoader.LoadAsync(attrDescrIds, cancellationToken));
            }
Example #2
0
 public Task <Model.AttrDescr> GetAttrDescrAsync(
     [ID(nameof(Model.Attr))] Guid id,
     AttrDescrByIdDataLoader dataLoader,
     CancellationToken cancellationToken) =>
 dataLoader.LoadAsync(id, cancellationToken);