public EFIngresCommand CreateEFIngresCommand(bool direct = false) { var cmd = new EFIngresCommand(this); cmd.Direct = direct; return(cmd); }
public CommandParser(EFIngresCommand command) { _command = command; _oldCommandText = _command.CommandText; _oldParameters = _command.Parameters.Cast <DbParameter>().ToList(); CatalogTables = new List <string>(); ChangeParameters(); }
object ICloneable.Clone() { EFIngresCommand clone = new EFIngresCommand(); clone.EFIngresConnection = EFIngresConnection; clone._wrappedCommand = (IngresCommand)((ICloneable)WrappedCommand).Clone(); return(clone); }
private void Init(EFIngresCommand command) { if (command != null) { CommandType = command.CommandType; CommandText = command.CommandText; Parameters = command.Parameters.Cast <IDbDataParameter>().ToList(); ModifiedCommandText = command.ModifiedCommandText; ModifiedParameters = command.ModifiedParameters.Cast <IDbDataParameter>().ToList(); } }
private static EFIngresCommand CreateCommand(EFIngresConnection connection, string commandText, int?commandTimeout) { Debug.Assert(connection != null); var command = new EFIngresCommand(commandText, connection); if (commandTimeout.HasValue) { command.CommandTimeout = commandTimeout.Value; } return(command); }
/// <summary> /// Create an EFIngresCommand object, given the provider manifest and command tree /// </summary> private DbCommand CreateCommand(DbProviderManifest manifest, DbCommandTree commandTree) { if (commandTree == null) { throw new ArgumentNullException("commandTree"); } var ingresManifest = Cast <EFIngresProviderManifest>(manifest, "manifest"); var version = ingresManifest.Version; var command = new EFIngresCommand(); List <DbParameter> parameters; CommandType commandType; command.CommandText = SqlGenerator.GenerateSql(commandTree, version, out parameters, out commandType); command.CommandType = commandType; if (command.CommandType == CommandType.Text) { //command.CommandText += Environment.NewLine + Environment.NewLine + "-- provider: " + this.GetType().Assembly.FullName; } // Get the function (if any) implemented by the command tree since this influences our interpretation of parameters EdmFunction function = null; if (commandTree is DbFunctionCommandTree) { function = ((DbFunctionCommandTree)commandTree).EdmFunction; } // Now make sure we populate the command's parameters from the CQT's parameters: command.Parameters.AddRange(commandTree.Parameters.Select(queryParameter => CreateDbParameter(queryParameter.Key, queryParameter.Value, ParameterMode.In, DBNull.Value)).ToArray()); // Now add parameters added as part of SQL gen (note: this feature is only safe for DML SQL gen which // does not support user parameters, where there is no risk of name collision) if (parameters != null && parameters.Count > 0) { if (!(commandTree is DbModificationCommandTree)) { throw new InvalidOperationException("SqlGenParametersNotPermitted"); } command.Parameters.AddRange(parameters.ToArray()); } return(command); }
public EFIngresCommandException(EFIngresCommand command, string message, Exception innerException) : base(message, innerException) { Init(command); }
public EFIngresCommandException(EFIngresCommand command, string message) : base(message) { Init(command); }
public EFIngresCommandException(EFIngresCommand command) : base() { Init(command); }