private ICollection <DataNode> RouteTables(ShardingRule shardingRule, TableRule tableRule, string routedDataSource, List <IRouteValue> tableShardingValues) { ICollection <string> availableTargetTables = tableRule.GetActualTableNames(routedDataSource); ICollection <string> routedTables = new HashSet <string>(tableShardingValues.IsEmpty() ? availableTargetTables : shardingRule.GetTableShardingStrategy(tableRule).DoSharding(availableTargetTables, tableShardingValues, this.Properties)); ShardingAssert.If(routedTables.IsEmpty(), "no table route info"); ICollection <DataNode> result = new LinkedList <DataNode>(); foreach (var routedTable in routedTables) { result.Add(new DataNode(routedDataSource, routedTable)); } return(result); }