|
23 | 23 | using ShardingCore.Exceptions; |
24 | 24 |
|
25 | 25 | using ShardingCore.Sharding.Abstractions; |
| 26 | +using ShardingCore.Sharding.MergeEngines.ParallelControl; |
26 | 27 | using ShardingCore.Sharding.ParallelTables; |
27 | 28 | using ShardingCore.Sharding.ReadWriteConfigurations.Abstractions; |
28 | 29 | using ShardingCore.Sharding.ShardingComparision.Abstractions; |
@@ -67,10 +68,11 @@ public void Initialize() |
67 | 68 | _serviceProvider = _serviceMap.BuildServiceProvider(); |
68 | 69 | _serviceProvider.GetRequiredService<IShardingInitializer>().Initialize(); |
69 | 70 | InitFieldValue(); |
| 71 | + AutoShardingCreate(); |
70 | 72 | } |
71 | 73 | } |
72 | 74 |
|
73 | | - public void AutoShardingCreate() |
| 75 | + private void AutoShardingCreate() |
74 | 76 | { |
75 | 77 | GetRequiredService<IShardingBootstrapper>().AutoShardingCreate(); |
76 | 78 | } |
@@ -217,40 +219,6 @@ public IDataSourceInitializer GetDataSourceInitializer() |
217 | 219 | return _dataSourceInitializer??=GetRequiredService<IDataSourceInitializer>(); |
218 | 220 | } |
219 | 221 |
|
220 | | - public void CheckRequirement() |
221 | | - { |
222 | | - if (isCheckRequirement) |
223 | | - return; |
224 | | - |
225 | | - lock (CHECK_REQUIREMENT) |
226 | | - { |
227 | | - if (isCheckRequirement) |
228 | | - return; |
229 | | - isCheckRequirement = true; |
230 | | - |
231 | | - try |
232 | | - { |
233 | | - var shardingProvider = GetShardingProvider(); |
234 | | - using (var scope = shardingProvider.CreateScope()) |
235 | | - { |
236 | | - using (var dbContext = _dbContextCreator.GetShellDbContext(scope.ServiceProvider)) |
237 | | - { |
238 | | - if (dbContext == null) |
239 | | - { |
240 | | - throw new ShardingCoreInvalidOperationException( |
241 | | - $"cant get shell db context,plz override {nameof(IDbContextCreator)}.{nameof(IDbContextCreator.GetShellDbContext)}"); |
242 | | - } |
243 | | - } |
244 | | - } |
245 | | - } |
246 | | - catch (Exception ex) |
247 | | - { |
248 | | - throw new ShardingCoreInvalidOperationException( |
249 | | - $"cant get shell db context,plz override {nameof(IDbContextCreator)}.{nameof(IDbContextCreator.GetShellDbContext)}", |
250 | | - ex); |
251 | | - } |
252 | | - } |
253 | | - } |
254 | 222 |
|
255 | 223 | public void GetOrCreateShardingRuntimeModel(DbContext dbContext) |
256 | 224 | { |
|
0 commit comments