Пример #1
0
        public ShardSetsBase(
            IOptions <TConfiguration> configOptions,
            IDataProviderServiceFactory dataProviderServices,
            DataConnectionConfigurationBase globalConfiguration,
            ILogger <ShardSetsBase <TConfiguration> > logger)
        {
            this._logger = logger;
            if (configOptions?.Value?.ShardSetsConfigInternal is null)
            {
                logger?.LogWarning("The ShardSets collection is missing required data connection information. Your application configuration may be missing a shard configuration section.");
            }
            this._dataProviderServices = dataProviderServices;
            this._globalConfiguration  = globalConfiguration;
            var bdr = ImmutableDictionary.CreateBuilder <string, ShardSet>();

            if (!(configOptions?.Value?.ShardSetsConfigInternal is null))
            {
                foreach (var set in configOptions.Value.ShardSetsConfigInternal)
                {
                    if (set is null)
                    {
                        throw new Exception($"A shard set configuration is not valid; the configuration provider returned null.");
                    }
                    bdr.Add(set.ShardSetName, new ShardSet(this, set));
                }
                this.dtn = bdr.ToImmutable();
            }
Пример #2
0
 public void SetAmbientConfiguration(DataConnectionConfigurationBase notUsed1, DataConnectionConfigurationBase notUsed2, DataConnectionConfigurationBase notUsed3, DataConnectionConfigurationBase notUsed4)
 {
     //
 }