private IShardingStrategy CreateDefaultShardingStrategy(IShardingStrategyConfiguration shardingStrategyConfiguration)
 {
     if (shardingStrategyConfiguration != null)
     {
         return(ShardingStrategyFactory.NewInstance(shardingStrategyConfiguration) ?? new NoneShardingStrategy());
     }
     return(new NoneShardingStrategy());
 }
Beispiel #2
0
 public static IShardingStrategy NewInstance(IShardingStrategyConfiguration shardingStrategyConfig)
 {
     if (shardingStrategyConfig is StandardShardingStrategyConfiguration shardingStrategyConfiguration)
     {
         return(new StandardShardingStrategy(shardingStrategyConfiguration));
     }
     if (shardingStrategyConfig is ComplexShardingStrategyConfiguration complexShardingStrategyConfiguration)
     {
         return(new ComplexShardingStrategy(complexShardingStrategyConfiguration));
     }
     if (shardingStrategyConfig is HintShardingStrategyConfiguration hintShardingStrategyConfiguration)
     {
         return(new HintShardingStrategy(hintShardingStrategyConfiguration));
     }
     return(new NoneShardingStrategy());
 }