Exemple #1
0
 public abstract Task <T?> LoadAsync(TId id, IMartenSession session, CancellationToken token);
 public override void CompileLocal(IMartenSession session)
 {
     Inner.CompileStructure(session);
     Inner = Inner.Top();
 }
Exemple #3
0
 public abstract void Store(IMartenSession session, T document);
Exemple #4
0
 public Task <IStorageOperation> DetermineOperation(IMartenSession session, StreamFragment <TDoc, TId> fragment,
                                                    CancellationToken cancellation)
 {
     return(Task.FromResult(DetermineOperationSync(session, fragment)));
 }
Exemple #5
0
 public void ConfigureCommand(CommandBuilder builder, IMartenSession session)
 {
     configure(builder);
 }
Exemple #6
0
        public IIncludeReader BuildReader(IMartenSession session)
        {
            var selector = (ISelector <T>)_storage.BuildSelector(session);

            return(new IncludeReader <T>(_callback, selector));
        }
 public WhereClauseParser(IMartenSession session, Statement statement)
 {
     _session   = session;
     _statement = statement;
     _holder    = this;
 }
        public IQueryHandler <TResult> BuildSingleResultHandler <TResult>(IMartenSession session, Statement topStatement)
        {
            var selector = (ISelector <TResult>)SelectClause.BuildSelector(session);

            return(new OneResultHandler <TResult>(topStatement, selector, ReturnDefaultWhenEmpty, CanBeMultiples));
        }
 public ISelector BuildSelector(IMartenSession session)
 {
     return(new SerializationSelector <T>(session.Serializer));
 }
 public Page(IMartenSession session)
 {
     _session = session;
     _builder = new CommandBuilder(_command);
 }
 private void startNewPage(IMartenSession session)
 {
     _current = new Page(session);
     _pages.Add(_current);
 }
Exemple #12
0
 public abstract ISelector BuildSelector(IMartenSession session);
Exemple #13
0
 public abstract Task <IReadOnlyList <T> > LoadManyAsync(TId[] ids, IMartenSession session, CancellationToken token);
Exemple #14
0
 public abstract IReadOnlyList <T> LoadMany(TId[] ids, IMartenSession session);
 public void ConfigureCommand(CommandBuilder builder, IMartenSession session)
 {
     builder.Append(_sql);
 }
Exemple #16
0
 public MartenLinqQueryable(IMartenSession session, MartenLinqQueryProvider provider, Expression expression) : base(provider,
                                                                                                                    expression)
 {
     Session        = session;
     MartenProvider = provider;
 }
 public MartenLinqQueryProvider(IMartenSession session)
 {
     _session = session;
 }
Exemple #18
0
 public MartenLinqQueryable(IMartenSession session, Expression expression) : base(new MartenLinqQueryProvider(session),
                                                                                  expression)
 {
     Session        = session;
     MartenProvider = TypeExtensions.As <MartenLinqQueryProvider>(Provider);
 }
 public abstract void ConfigureCommand(CommandBuilder builder, IMartenSession session);
 public sealed override void Store(IMartenSession session, T document, Guid?version)
 {
 }
Exemple #21
0
 public abstract Task <IStorageOperation> DetermineOperation(IMartenSession session, StreamFragment <TDoc, TId> fragment, CancellationToken cancellation);
 public sealed override void Eject(IMartenSession session, T document)
 {
 }
Exemple #23
0
 public abstract IStorageOperation DetermineOperationSync(IMartenSession session, StreamFragment <TDoc, TId> fragment);
        public sealed override async Task <IReadOnlyList <T> > LoadManyAsync(TId[] ids, IMartenSession session,
                                                                             CancellationToken token)
        {
            var list = new List <T>();

            var command  = BuildLoadManyCommand(ids, session.Tenant);
            var selector = (ISelector <T>)BuildSelector(session);

            using (var reader = await session.Database.ExecuteReaderAsync(command, token).ConfigureAwait(false))
            {
                while (await reader.ReadAsync(token).ConfigureAwait(false))
                {
                    var document = await selector.ResolveAsync(reader, token).ConfigureAwait(false);

                    list.Add(document);
                }
            }

            return(list);
        }
 public IQueryHandler <T> BuildHandler <T>(IMartenSession session, Statement topStatement,
                                           Statement currentStatement)
 {
     // It's wrapped in LinqHandlerBuilder
     return(_clonedEnd.SelectClause.BuildHandler <T>(session, topStatement, currentStatement));
 }
 public sealed override T Load(TId id, IMartenSession session)
 {
     return(load(id, session));
 }
 public ISelector BuildSelector(IMartenSession session)
 {
     throw new System.NotSupportedException();
 }
 public sealed override Task <T> LoadAsync(TId id, IMartenSession session, CancellationToken token)
 {
     return(loadAsync(id, session, token));
 }
Exemple #29
0
 public abstract void Store(IMartenSession session, T document, Guid?version);
Exemple #30
0
 public abstract T?Load(TId id, IMartenSession session);