public ConfigureRequestExecutorSetup( NameString schemaName, RequestExecutorSetup options) { SchemaName = schemaName.EnsureNotEmpty(nameof(schemaName)); _configure = options.CopyTo; }
public void Configure(RequestExecutorSetup options) { if (options is null) { throw new ArgumentNullException(nameof(options)); } _configure(options); }
public void CopyTo(RequestExecutorSetup options) { options.Schema = Schema; options.SchemaBuilder = SchemaBuilder; options.RequestExecutorOptions = RequestExecutorOptions; options._schemaBuilderActions.AddRange(_schemaBuilderActions); options._requestExecutorOptionsActions.AddRange(_requestExecutorOptionsActions); options._pipeline.AddRange(_pipeline); options._schemaServices.AddRange(_schemaServices); options._onRequestExecutorCreated.AddRange(_onRequestExecutorCreated); options._onRequestExecutorEvicted.AddRange(_onRequestExecutorEvicted); }
public async ValueTask <RequestExecutorSetup> GetAsync( NameString schemaName, CancellationToken cancellationToken = default) { await InitializeAsync(cancellationToken).ConfigureAwait(false); var options = new RequestExecutorSetup(); _optionsMonitor.Get(schemaName).CopyTo(options); if (_configs.TryGetValue( schemaName, out List <IConfigureRequestExecutorSetup>?configurations)) { foreach (IConfigureRequestExecutorSetup configuration in configurations) { configuration.Configure(options); } } return(options); }