internal EntityCommand(EntityDataReaderFactory factory) { // Initalize the member field with proper default values _designTimeVisible = true; _commandType = CommandType.Text; _updatedRowSource = UpdateRowSource.Both; _parameters = new EntityParameterCollection(); // Future Enhancement: (See SQLPT #300004256) At some point it would be // really nice to read defaults from a global configuration, but we're not // doing that today. _enableQueryPlanCaching = true; _entityDataReaderFactory = factory ?? new EntityDataReaderFactory(); }
/// <summary> /// Internal constructor used by EntityCommandDefinition /// </summary> /// <param name="commandDefinition"> The prepared command definition that can be executed using this EntityCommand </param> internal EntityCommand(EntityCommandDefinition commandDefinition, EntityDataReaderFactory factory = null) : this(factory) { // Assign other member fields from the parameters _commandDefinition = commandDefinition; _parameters = new EntityParameterCollection(); // Make copies of the parameters foreach (var parameter in commandDefinition.Parameters) { _parameters.Add(parameter.Clone()); } // Reset the dirty flag that was set to true when the parameters were added so that it won't say // it's dirty to start with _parameters.ResetIsDirty(); // Track the fact that this command was created from and represents an already prepared command definition _isCommandDefinitionBased = true; }
internal EntityCommand(string statement, DbInterceptionContext context, EntityDataReaderFactory factory) : this(context, factory) { _esqlCommandText = statement; }
// <summary> // Constructs a new EntityCommand given a EntityConnection and an EntityCommandDefition. This // constructor is used by ObjectQueryExecution plan to execute an ObjectQuery. // </summary> // <param name="connection"> The connection against which this EntityCommand should execute </param> // <param name="entityCommandDefinition"> The prepared command definition that can be executed using this EntityCommand </param> internal EntityCommand( EntityConnection connection, EntityCommandDefinition entityCommandDefinition, DbInterceptionContext context, EntityDataReaderFactory factory = null) : this(entityCommandDefinition, context, factory) { _connection = connection; }
internal EntityCommand( string statement, EntityConnection connection, EntityTransaction transaction, EntityDataReaderFactory factory) : this(statement, connection, factory) { _transaction = transaction; }
internal EntityCommand(string statement, EntityConnection connection, EntityDataReaderFactory factory) : this(statement, new DbInterceptionContext(), factory) { _connection = connection; }
internal EntityCommand(string statement, EntityConnection connection, EntityDataReaderFactory factory) : this(statement, factory) { _connection = connection; }
internal EntityCommand(string statement, EntityDataReaderFactory factory) : this(factory) { _esqlCommandText = statement; }
/// <summary> /// Constructs a new EntityCommand given a EntityConnection and an EntityCommandDefition. This /// constructor is used by ObjectQueryExecution plan to execute an ObjectQuery. /// </summary> /// <param name="connection">The connection against which this EntityCommand should execute</param> /// <param name="commandDefinition">The prepared command definition that can be executed using this EntityCommand</param> internal EntityCommand( EntityConnection connection, EntityCommandDefinition entityCommandDefinition, EntityDataReaderFactory factory = null) : this(entityCommandDefinition, factory) { _connection = connection; }
/// <summary> /// Internal constructor used by EntityCommandDefinition /// </summary> /// <param name="commandDefinition">The prepared command definition that can be executed using this EntityCommand</param> internal EntityCommand(EntityCommandDefinition commandDefinition, EntityDataReaderFactory factory = null) : this(factory) { // Assign other member fields from the parameters _commandDefinition = commandDefinition; _parameters = new EntityParameterCollection(); // Make copies of the parameters foreach (var parameter in commandDefinition.Parameters) { _parameters.Add(parameter.Clone()); } // Reset the dirty flag that was set to true when the parameters were added so that it won't say // it's dirty to start with _parameters.ResetIsDirty(); // Track the fact that this command was created from and represents an already prepared command definition _isCommandDefinitionBased = true; }