public void QueryExecutorOptions( SchemaCreation creation, string executorName) { // arrange IHttpClientFactory clientFactory = CreateRemoteSchemas(); var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton(clientFactory); // act serviceCollection.AddStitchedSchema(b => b .AddSchemaFromHttp("contract") .SetSchemaCreation(creation)); // assert IServiceProvider services = serviceCollection.BuildServiceProvider(); IQueryExecutor executor = services .GetRequiredService <IQueryExecutor>(); Assert.Equal(executorName, executor.GetType().Name); }
public static async Task Main(string[] args) { var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var connection = scope.ServiceProvider.GetRequiredService <IConfiguration>() .GetConnectionString("postgres"); var schema = new SchemaCreation(connection); await schema.CreateTable(CancellationToken.None); } await host.RunAsync(); }
public IStitchingBuilder SetSchemaCreation(SchemaCreation creation) { _buildOnFirstRequest = creation == SchemaCreation.OnFirstRequest; return(this); }
public IStitchingBuilder SetSchemaCreation(SchemaCreation creation) { throw new NotImplementedException(); }