public object ExecuteScalarShard(LogicalShard shard, IDbCommand command) { using (var conn = shard.physicalShard.GetConnection()) { command.Connection = conn; command.CommandText = SchemaSelectByShard(shard.id) + command.CommandText; OpenConnection(conn); return(command.ExecuteScalar()); } }
public int ExecuteNonQueryShard(LogicalShard shard, IDbCommand command) { using (var conn = shard.physicalShard.GetConnection()) { OpenConnection(conn); command.Connection = conn; command.CommandText = SchemaSelectByShard(shard.id) + command.CommandText; int res = command.ExecuteNonQuery(); return(res); } }