public static GremlinqSetup UseConfigurationSection(this GremlinqSetup setup, string sectionName) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton <IGremlinqConfiguration>(serviceProvider => new GremlinqConfiguration(serviceProvider .GetServiceOrThrow <IConfiguration>() .GetSection(sectionName) .GetSection("Gremlinq"))))); }
public static GremlinqSetup UseProvider <TConfigurator>( this GremlinqSetup setup, string sectionName, Func <IConfigurableGremlinQuerySource, Func <TConfigurator, IGremlinQuerySourceTransformation>, IGremlinQuerySource> providerChoice, Action <ProviderSetup <TConfigurator> > setupAction, Action <ProviderSetup <TConfigurator> >?extraSetupAction) where TConfigurator : IProviderConfigurator <TConfigurator> { setupAction(new ProviderSetup <TConfigurator>(setup.ServiceCollection)); if (extraSetupAction is { } extraConfiguration) { extraConfiguration(new ProviderSetup <TConfigurator>(setup.ServiceCollection)); } return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton(new ProviderSetupInfo <TConfigurator>(sectionName, providerChoice)) .AddSingleton <IGremlinQuerySourceTransformation, UseProviderGremlinQuerySourceTransformation <TConfigurator> >() .AddSingleton <IProviderConfigurationSection, ProviderConfigurationSection <TConfigurator> >())); }
public static GremlinqSetup ConfigureEnvironment(this GremlinqSetup setup, Func <IGremlinQueryEnvironment, IGremlinQueryEnvironment> environmentTransformation) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton <IGremlinQueryEnvironmentTransformation>(new EnvironmentTransformation(environmentTransformation)))); }
public static GremlinqSetup UseModel(this GremlinqSetup setup, IGraphModel model) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton(model) .AddSingleton <IGremlinQueryEnvironmentTransformation, UseModelTransformation>())); }
public static GremlinqSetup ConfigureWebSocketBuilder(this GremlinqSetup setup, Func <IWebSocketGremlinQueryExecutorBuilder, IWebSocketGremlinQueryExecutorBuilder> transformation) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton <IWebSocketGremlinQueryExecutorBuilderTransformation>(_ => new ConfigureWebSocketGremlinQueryExecutorBuilderTransformation(transformation)))); }
public static GremlinqSetup UseWebSocket(this GremlinqSetup setup) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton <IGremlinQueryEnvironmentTransformation, ConfigureLoggingGremlinQueryEnvironmentTransformation>())); }
public static GremlinqSetup ConfigureQuerySource(this GremlinqSetup setup, Func <IGremlinQuerySource, IGremlinQuerySource> sourceTranformation) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton <IGremlinQuerySourceTransformation>(new SourceTransformation(sourceTranformation)))); }
public static GremlinqSetup UseConfigurationSection(this GremlinqSetup setup, string sectionName) { return(setup.RegisterTypes(serviceCollection => serviceCollection .AddSingleton(new GremlinqSetupInfo(sectionName)))); }