public RouteResult Route(ShardingRule shardingRule) { if (IsDMLForModify(SqlCommandContext) && 1 != ((ITableAvailable)SqlCommandContext).GetAllTables().Count) { throw new ShardingException($"Cannot support Multiple-Table for '{SqlCommandContext.GetSqlCommand()}'."); } return(GenerateRouteResult(GetDataNodes(shardingRule, shardingRule.GetTableRule(LogicTableName)))); }
public ICommandContext CreateCommand(string text, CommandType commandType, ITransaction transaction) { var command = new SqlCommandContext(Connection, text, commandType, transaction); return command; }
public ICommandContext CreateCommand(string text) { var command = new SqlCommandContext(Connection, text, CommandType.StoredProcedure); return command; }