private Func <DbContext, CancellationToken, string, Task <TReadModel> > CompileQueryById(
     IApplyQueryableConfiguration <TReadModel> queryableConfiguration,
     bool tracking)
 {
     return(tracking
         ? EF.CompileAsyncQuery((DbContext dbContext, CancellationToken t, string id) =>
                                queryableConfiguration.Apply(dbContext
                                                             .Set <TReadModel>()
                                                             .AsTracking())
                                .SingleOrDefault(e => EF.Property <string>(e, Key) == id))
         : EF.CompileAsyncQuery((DbContext dbContext, CancellationToken t, string id) =>
                                queryableConfiguration.Apply(
                                    dbContext
                                    .Set <TReadModel>()
                                    .AsNoTracking())
                                .SingleOrDefault(e => EF.Property <string>(e, Key) == id)));
 }
Beispiel #2
0
 private IIncludableQueryable <TReadModel, TProperty> ApplyInternal(IQueryable <TReadModel> queryable) =>
 _source.Apply(queryable).Include(_navigationPropertyPath);
Beispiel #3
0
 IQueryable <TReadModel> IApplyQueryableConfiguration <TReadModel> .Apply(
     IQueryable <TReadModel> queryable) =>
 _source.Apply(queryable).Include(_navigationPropertyPath);