public static IApplicationBuilder UseRoutine(this IApplicationBuilder source, Func <CodingStyleBuilder, ICodingStyle> codingStyle, Func <ServiceConfigurationBuilder, IServiceConfiguration> serviceConfiguration = null, IRestClient restClient = null, IJsonSerializer serializer = null, ICache cache = null, Func <InterceptionConfigurationBuilder, IInterceptionConfiguration> interceptionConfiguration = null ) { serviceConfiguration ??= s => s.FromBasic(); interceptionConfiguration ??= i => i.FromBasic(); return(source.UseMiddleware <RoutineMiddleware>( BuildRoutine.Context() .Using( restClient: restClient, serializer: serializer, cache: cache, interceptionConfiguration: interceptionConfiguration(BuildRoutine.InterceptionConfig()) ) .AsServiceApplication(serviceConfiguration, codingStyle) )); }