File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -419,15 +419,11 @@ private DbContext GetDbContextByKeyValue(params object[] keyValues)
419419 var isShardingDataSource = entityMetadata . IsShardingDataSource ( ) ;
420420 var shardingDataSourceFieldIsKey = entityMetadata . ShardingDataSourceFieldIsKey ( ) ;
421421 if ( isShardingDataSource && ! shardingDataSourceFieldIsKey )
422- {
423- throw new ShardingCoreNotSupportException ( "multi data source entity find key should sharding value" ) ;
424- }
422+ return null ;
425423 var isShardingTable = entityMetadata . IsShardingTable ( ) ;
426424 var shardingTableFieldIsKey = entityMetadata . ShardingTableFieldIsKey ( ) ;
427425 if ( isShardingTable && ! shardingTableFieldIsKey )
428- {
429- throw new ShardingCoreNotSupportException ( "multi table entity find key should sharding value" ) ;
430- }
426+ return null ;
431427 var primaryKeyValue = keyValues [ 0 ] ;
432428 if ( primaryKeyValue != null )
433429 {
@@ -439,7 +435,7 @@ private DbContext GetDbContextByKeyValue(params object[] keyValues)
439435 }
440436 }
441437
442- throw new ShardingCoreNotSupportException ( "sharding entity multi key" ) ;
438+ return null ;
443439 }
444440
445441 private string GetDataSourceName ( object shardingKeyValue )
You can’t perform that action at this time.
0 commit comments