Beispiel #1
0
        public Task <IReadOnlyList <T> > QueryAsync <T>(string sql, CancellationToken token, params object[] parameters)
        {
            assertNotDisposed();
            var handler  = new UserSuppliedQueryHandler <T>(this, sql, parameters);
            var provider = new MartenLinqQueryProvider(this);

            return(provider.ExecuteHandlerAsync(handler, token));
        }
Beispiel #2
0
        public async Task <IReadOnlyList <T> > QueryAsync <T>(string sql, CancellationToken token, params object[] parameters)
        {
            assertNotDisposed();

            var handler = new UserSuppliedQueryHandler <T>(this, sql, parameters);

            if (!handler.SqlContainsCustomSelect)
            {
                await Database.EnsureStorageExistsAsync(typeof(T), token).ConfigureAwait(false);
            }

            var provider = new MartenLinqQueryProvider(this);

            return(await provider.ExecuteHandlerAsync(handler, token).ConfigureAwait(false));
        }