Exemple #1
0
        internal void RegisterRequestProviders()
        {
            RequestProviderFactory = new RequestProviderFactory();

            RegisterSyncRequestProvider(new SyncRequestProvider(this));
            RequestExecutorFactory.RegisterSyncRequestProvider(new SyncRequestExecutor());
#if Async
            RegisterAsyncRequestProvider(new AsyncRequestProvider(this));
            RequestExecutorFactory.RegisterAsyncRequestProvider(new AsyncRequestExecutor());
#endif
        }
        internal void RegisterRequestProviders()
        {
            RequestProviderFactory = new RequestProviderFactory();

            RegisterSyncRequestProvider(() => new SyncRequestProvider(this));
            if (RequestExecutorFactory.GetSyncRequestExecutor() == null)
            {
                RequestExecutorFactory.RegisterSyncRequestProvider(new SyncRequestExecutor());
            }
#if ASYNC
            RegisterAsyncRequestProvider(() => new AsyncRequestProvider(this));
            if (RequestExecutorFactory.GetAsyncRequestExecutor() == null)
            {
                RequestExecutorFactory.RegisterAsyncRequestProvider(new AsyncRequestExecutor());
            }
#endif
        }
 public virtual void Execute(IQuery query)
 {
     RequestProviderFactory.GetSyncRequestProvider().Execute(query);
 }
 public virtual T Execute <T>(IQuery <T> query)
     where T : class
 {
     return(RequestProviderFactory.GetSyncRequestProvider().Execute(query));
 }
 public virtual Stream Execute(IQuery <Stream> stream)
 {
     return(RequestProviderFactory.GetSyncRequestProvider().Execute(stream));
 }
 public virtual Task ExecuteAsync(IQuery query, CancellationToken token = default(CancellationToken))
 {
     return(RequestProviderFactory.GetAsyncRequestProvider().ExecuteAsync(query, token));
 }
 public virtual Task <T> ExecuteAsync <T>(IQuery <T> query, CancellationToken token = default(CancellationToken))
     where T : class
 {
     return(RequestProviderFactory.GetAsyncRequestProvider().ExecuteAsync(query, token));
 }
 public virtual Task <Stream> ExecuteAsync(IQuery <Stream> stream, CancellationToken token = default(CancellationToken))
 {
     return(RequestProviderFactory.GetAsyncRequestProvider().ExecuteAsync(stream, token));
 }
Exemple #9
0
 public virtual Task <Stream> ExecuteAsync(IStreamQuery stream, CancellationToken?token = null)
 {
     return(RequestProviderFactory.GetAsyncRequestProvider().ExecuteAsync(stream, token));
 }
Exemple #10
0
 public void RegisterAsyncRequestProvider(IAsyncRequestProvider asyncRequestProvider)
 {
     RequestProviderFactory.RegisterAsyncRequestProvider(asyncRequestProvider);
 }
Exemple #11
0
 public void RegisterSyncRequestProvider(ISyncRequestProvider syncRequestProvider)
 {
     RequestProviderFactory.RegisterSyncRequestProvider(syncRequestProvider);
 }