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))); }
private IIncludableQueryable <TReadModel, TProperty> ApplyInternal(IQueryable <TReadModel> queryable) => _source.Apply(queryable).Include(_navigationPropertyPath);
IQueryable <TReadModel> IApplyQueryableConfiguration <TReadModel> .Apply( IQueryable <TReadModel> queryable) => _source.Apply(queryable).Include(_navigationPropertyPath);