public static IAdvancedGraphQLBuilder OnResult <TResult>(this IAdvancedGraphQLBuilder builder, Action <TypedResultContext <TResult> > handler) { builder.WithConfiguration(s => s.WithResultType(typeof(TResult))); builder.WithConfiguration(s => s.HandlerRegister.WithResultHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnSent <TResult>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Action <TypedSentContext <TResult> > handler) { builder.WithConfiguration(s => s.WithResultType(typeof(TResult))); builder.WithConfiguration(s => s.HandlerRegister.WithSentHandler(priority, handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnSentAsync <TResult>(this IAdvancedGraphQLBuilder builder, Func <TypedSentContext <TResult>, Task> handler) { builder.WithConfiguration(s => s.WithResultType(typeof(TResult))); builder.WithConfiguration(s => s.HandlerRegister.WithAsyncSentHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnSendingWithContent <TContent>(this IAdvancedGraphQLBuilder builder, Action <TypedSendingContext <object, TContent> > handler) { builder.WithConfiguration(s => s.WithContentType(typeof(TContent))); builder.WithConfiguration(s => s.HandlerRegister.WithSendingHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnSendingWithContentAsync <TContent>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <TypedSendingContext <object, TContent>, Task> handler) { builder.WithConfiguration(s => s.WithContentType(typeof(TContent))); builder.WithConfiguration(s => s.HandlerRegister.WithAsyncSendingHandler(priority, handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnError <TError>(this IAdvancedGraphQLBuilder builder, Action <TypedErrorContext <TError> > handler) { builder.WithConfiguration(s => s.WithErrorType(typeof(TError))); builder.WithConfiguration(s => s.HandlerRegister.WithErrorHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnResultAsync <TResult>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <TypedResultContext <TResult>, Task> handler) { builder.WithConfiguration(s => s.WithResultType(typeof(TResult))); builder.WithConfiguration(s => s.HandlerRegister.WithAsyncResultHandler(priority, handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnErrorAsync <TError>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <TypedErrorContext <TError>, Task> handler) { builder.WithConfiguration(s => s.WithErrorType(typeof(TError))); builder.WithConfiguration(s => s.HandlerRegister.WithAsyncErrorHandler(priority, handler)); return(builder); }
// public static IAdvancedGraphQLBuilder WithHttpContentFactory<TContent>(this IAdvancedGraphQLBuilder builder, Func<ITypedBuilderContext, object, Task<HttpContent>> contentFactory) // where TContent : IGraphQLRequest // { // builder.WithConfiguration(s => s.WithContentType(typeof(TContent)).HttpContentFactory = async (ctx, content) => await contentFactory(ctx, content)); // return builder; // } // public static IAdvancedGraphQLBuilder WithHttpContentFactory(this IAdvancedGraphQLBuilder builder, Func<ITypedBuilderContext, object, Task<HttpContent>> contentFactory) // { // builder.WithConfiguration(s => s.HttpContentFactory = contentFactory); // return builder; // } // public static IAdvancedGraphQLBuilder WithResultFactory<TResult>(this IAdvancedGraphQLBuilder builder, Func<ITypedBuilderContext, HttpRequestMessage, HttpResponseMessage, Task<TResult>> resultFactory) // where TResult : IGraphQLResource // { // builder.WithConfiguration(s => s.WithResultType(typeof(TResult)).ResultFactory = async (ctx, request, response) => await resultFactory(ctx, request, response)); // return builder; // } // public static IAdvancedGraphQLBuilder WithResultFactory(this IAdvancedGraphQLBuilder builder, Func<ITypedBuilderContext, HttpRequestMessage, HttpResponseMessage, Task<object>> resultFactory) // { // builder.WithConfiguration(s => s.ResultFactory = resultFactory); // return builder; // } public static IAdvancedGraphQLBuilder WithErrorFactory <TError>(this IAdvancedGraphQLBuilder builder, Func <ITypedBuilderContext, HttpRequestMessage, HttpResponseMessage, Exception, Task <TError> > errorFactory) { builder.WithConfiguration(s => s.WithResultType(typeof(TError)).ErrorFactory = async(ctx, request, response, ex) => await errorFactory(ctx, request, response, ex)); return(builder); }
public static IAdvancedGraphQLBuilder WithAutoFollowConfiguration(this IAdvancedGraphQLBuilder builder, Action <FollowLocationHandler> configuration) { builder.WithConfiguration(b => b.WithAutoFollowConfiguration(configuration)); return(builder); }
public static IAdvancedGraphQLBuilder WithOptionalHttpHandlerConfiguration <THandler>(this IAdvancedGraphQLBuilder builder, Action <THandler> configure) where THandler : class, ITypedHandler { builder.WithConfiguration(b => b.WithOptionalHttpHandlerConfiguration(configure)); return(builder); }
public static IAdvancedGraphQLBuilder WithRedirectConfiguration(this IAdvancedGraphQLBuilder builder, Action <RedirectHandler> configuration) { builder.WithConfiguration(b => b.WithRedirectConfiguration(configuration)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheExpired(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Action <CacheExpiredContext> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithExpiredHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder WithSuccessfulResponseValidator(this IAdvancedGraphQLBuilder builder, Func <HttpResponseMessage, bool> validator) { if (validator == null) { throw new ArgumentNullException(nameof(validator)); } return(builder.WithConfiguration(b => b.WithSuccessfulResponseValidator(validator))); }
public static IAdvancedGraphQLBuilder OnCacheStoreAsync <TResult>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <CacheStoreContext <TResult>, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncStoreHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheStore <TResult>(this IAdvancedGraphQLBuilder builder, Action <CacheStoreContext <TResult> > cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithStoreHandler(cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheStoreAsync(this IAdvancedGraphQLBuilder builder, Func <CacheStoreContext <object>, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncStoreHandler(cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheStore(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Action <CacheStoreContext <object> > cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithStoreHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheMissAsync <TResult>(this IAdvancedGraphQLBuilder builder, Func <CacheMissContext <TResult>, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncMissHandler(cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheMiss <TResult>(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Action <CacheMissContext <TResult> > cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithMissHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheMissAsync(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <CacheMissContext <object>, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncMissHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder WithSuppressCancellationExceptions(this IAdvancedGraphQLBuilder builder, bool suppress = true) { return(builder.WithConfiguration(b => b.WithSuppressCancellationExceptions(suppress))); }
public static IAdvancedGraphQLBuilder OnCacheMiss(this IAdvancedGraphQLBuilder builder, Action <CacheMissContext <object> > cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithMissHandler(cacheHandler)); return(builder); }
// public static IAdvancedGraphQLBuilder WithAcceptHeaderValue(this IAdvancedGraphQLBuilder builder, string mediaType) // { // return builder.WithConfiguration(b => b.WithAcceptHeaderValue(mediaType)); // } // public static IAdvancedGraphQLBuilder WithAcceptCharSet(this IAdvancedGraphQLBuilder builder, Encoding encoding) // { // return builder.WithConfiguration(b => b.WithAcceptCharSet(encoding)); // } // public static IAdvancedGraphQLBuilder WithAcceptCharSet(this IAdvancedGraphQLBuilder builder, string charSet) // { // return builder.WithConfiguration(b => b.WithAcceptCharSet(charSet)); // } public static IAdvancedGraphQLBuilder WithAutoDecompression(this IAdvancedGraphQLBuilder builder, bool enabled = true) { return(builder.WithConfiguration(b => b.WithAutoDecompression(enabled))); }
public static IAdvancedGraphQLBuilder OnCacheExpiring(this IAdvancedGraphQLBuilder builder, Action <CacheExpiringContext> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithExpiringHandler(cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnErrorAsync(this IAdvancedGraphQLBuilder builder, Func <TypedErrorContext <object>, Task> handler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncErrorHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheExpiringAsync(this IAdvancedGraphQLBuilder builder, Func <CacheExpiringContext, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncExpiringHandler(cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnException(this IAdvancedGraphQLBuilder builder, Action <TypedExceptionContext> handler) { builder.WithConfiguration(s => s.HandlerRegister.WithExceptionHandler(handler)); return(builder); }
public static IAdvancedGraphQLBuilder OnCacheExpiredAsync(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <CacheExpiredContext, Task> cacheHandler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncExpiredHandler(priority, cacheHandler)); return(builder); }
public static IAdvancedGraphQLBuilder OnExceptionAsync(this IAdvancedGraphQLBuilder builder, HandlerPriority priority, Func <TypedExceptionContext, Task> handler) { builder.WithConfiguration(s => s.HandlerRegister.WithAsyncExceptionHandler(priority, handler)); return(builder); }