EntityCommand Classe
Definição
Representa um comando para a camada conceitual.Represents a command for the conceptual layer.
public ref class EntityCommand sealed : System::Data::Common::DbCommand
public sealed class EntityCommand : System.Data.Common.DbCommand
type EntityCommand = class
inherit DbCommand
Public NotInheritable Class EntityCommand
Inherits DbCommand
- Herança
Construtores
| EntityCommand() |
Inicializa uma nova instância da classe EntityCommand usando os valores especificados.Initializes a new instance of the EntityCommand class using the specified values. |
| EntityCommand(String) |
Inicializa uma nova instância da classe EntityCommand com a instrução especificada.Initializes a new instance of the EntityCommand class with the specified statement. |
| EntityCommand(String, EntityConnection) |
Inicializa uma nova instância da classe EntityCommand com a conexão e instrução especificadas.Initializes a new instance of the EntityCommand class with the specified statement and connection. |
| EntityCommand(String, EntityConnection, EntityTransaction) |
Inicializa uma nova instância da classe EntityCommand com o estado, conexão e transação especificados.Initializes a new instance of the EntityCommand class with the specified statement, connection and transaction. |
Propriedades
| CanRaiseEvents |
Obtém um valor que indica se o componente pode acionar um evento.Gets a value indicating whether the component can raise an event. (Herdado de Component) |
| CommandText |
Obtém ou define uma instrução de Entity SQL que especifica um comando ou procedimento armazenado a ser executado.Gets or sets an Entity SQL statement that specifies a command or stored procedure to execute. |
| CommandTimeout |
Obtém ou define o tempo de espera antes do tempo limite ser excedido.Gets or sets the amount of time to wait before timing out. |
| CommandTree |
Obtém ou define a árvore de comando a ser executada; somente uma da árvore ou texto de comandos pode ser definido, não ambos.Gets or sets the command tree to execute; only one of the command tree or the command text can be set, not both. |
| CommandType |
Obtém ou define um valor que indica como a propriedade CommandText deve ser interpretada.Gets or sets a value that indicates how the CommandText property is to be interpreted. |
| Connection |
Obtém ou define o EntityConnection usado pelo EntityCommand.Gets or sets the EntityConnection used by the EntityCommand. |
| Container |
Obtém o IContainer que contém o Component.Gets the IContainer that contains the Component. (Herdado de Component) |
| DbConnection |
Quando substituído em uma classe derivada, obtém ou define o DbConnection usado por este DbCommand.When overridden in a derived class, gets or sets the DbConnection used by this DbCommand. (Herdado de DbCommand) |
| DbParameterCollection |
Quando substituído em uma classe derivada, obtém a coleção de objetos DbParameter.When overridden in a derived class, gets the collection of DbParameter objects. (Herdado de DbCommand) |
| DbTransaction |
Quando substituído em uma classe derivada, obtém ou define o DbTransaction dentro do qual este objeto DbCommand é executado.When overridden in a derived class, gets or sets the DbTransaction within which this DbCommand object executes. (Herdado de DbCommand) |
| DesignMode |
Obtém um valor que indica se o Component está no modo de design no momento.Gets a value that indicates whether the Component is currently in design mode. (Herdado de Component) |
| DesignTimeVisible |
Obtém ou define um valor que indica se o objeto de comando deve estar visível em um controle do Windows Form Designer.Gets or sets a value that indicates whether the command object should be visible in a Windows Form Designer control. |
| EnablePlanCaching |
Obtém ou define um valor que indica se o cache do plano de consulta está habilitado.Gets or sets a value that indicates whether the query plan caching is enabled. |
| Events |
Obtém a lista de manipuladores de eventos que estão anexados a este Component.Gets the list of event handlers that are attached to this Component. (Herdado de Component) |
| Parameters |
Obtém os parâmetros da instrução Entity SQL ou do procedimento armazenado.Gets the parameters of the Entity SQL statement or stored procedure. |
| Site |
Obtém ou define o ISite do Component.Gets or sets the ISite of the Component. (Herdado de Component) |
| Transaction |
Obtém ou define a transação na qual o SqlCommand é executado.Gets or sets the transaction within which the SqlCommand executes. |
| UpdatedRowSource |
Obtém ou define como os resultados do comando são aplicados às linhas sendo atualizadas.Gets or sets how command results are applied to rows being updated. |
Métodos
| Cancel() |
Cancela a execução de um EntityCommand.Cancels the execution of an EntityCommand. |
| CreateDbParameter() |
Quando substituído em uma classe derivada, cria uma nova instância de um objeto DbParameter.When overridden in a derived class, creates a new instance of a DbParameter object. (Herdado de DbCommand) |
| CreateObjRef(Type) |
Cria um objeto que contém todas as informações relevantes necessárias para gerar um proxy usado para se comunicar com um objeto remoto.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Herdado de MarshalByRefObject) |
| CreateParameter() |
Cria uma nova instância de um objeto EntityParameter.Creates a new instance of an EntityParameter object. |
| Dispose() |
Realiza tarefas definidas pelo aplicativo associadas à liberação ou à redefinição de recursos não gerenciados.Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Herdado de DbCommand) |
| Dispose(Boolean) |
Libera os recursos não gerenciados usados pelo DbCommand e opcionalmente libera os recursos gerenciados.Releases the unmanaged resources used by the DbCommand and optionally releases the managed resources. (Herdado de DbCommand) |
| DisposeAsync() |
Descarta de forma assíncrona o objeto de comando.Asynchronously diposes the command object. (Herdado de DbCommand) |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object. (Herdado de Object) |
| ExecuteDbDataReader(CommandBehavior) |
Quando substituído em uma classe derivada, executa o texto de comando em relação à conexão.When overridden in a derived class, executes the command text against the connection. (Herdado de DbCommand) |
| ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) |
Os provedores devem implementar esse método para fornecer uma implementação não padrão para sobrecargas ExecuteReader.Providers should implement this method to provide a non-default implementation for ExecuteReader overloads. A implementação padrão invoca o método ExecuteReader() síncrono e retorna uma tarefa concluída, bloqueando o thread de chamada.The default implementation invokes the synchronous ExecuteReader() method and returns a completed task, blocking the calling thread. A implementação padrão retornará uma tarefa cancelada se já tiver passado um token de cancelamento.The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceções geradas por ExecuteReader serão comunicadas por meio da propriedade Exceção de Tarefa retornada.Exceptions thrown by ExecuteReader will be communicated via the returned Task Exception property. Esse método aceita um token de cancelamento que pode ser usado para solicitar a operação a ser cancelada no início.This method accepts a cancellation token that can be used to request the operation to be cancelled early. As implementações podem ignorar essa solicitação.Implementations may ignore this request. (Herdado de DbCommand) |
| ExecuteNonQuery() |
Executa o comando atual.Executes the current command. |
| ExecuteNonQueryAsync() |
Uma versão assíncrona de ExecuteNonQuery(), que executa uma instrução SQL em um objeto de conexão.An asynchronous version of ExecuteNonQuery(), which executes a SQL statement against a connection object. Invoca ExecuteNonQueryAsync(CancellationToken) com CancellationToken.None.Invokes ExecuteNonQueryAsync(CancellationToken) with CancellationToken.None. (Herdado de DbCommand) |
| ExecuteNonQueryAsync(CancellationToken) |
Essa é a versão assíncrona de ExecuteNonQuery().This is the asynchronous version of ExecuteNonQuery(). Provedores devem substituir com uma implementação apropriada.Providers should override with an appropriate implementation. Opcionalmente, o token de cancelamento pode ser ignorado.The cancellation token may optionally be ignored. A implementação padrão invoca o método ExecuteNonQuery() síncrono e retorna uma tarefa concluída, bloqueando o thread de chamada.The default implementation invokes the synchronous ExecuteNonQuery() method and returns a completed task, blocking the calling thread. A implementação padrão retornará uma tarefa cancelada se já tiver passado um token de cancelamento.The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceções geradas por ExecuteNonQuery() serão comunicadas por meio da propriedade Exceção de Tarefa retornada.Exceptions thrown by ExecuteNonQuery() will be communicated via the returned Task Exception property. Não invoque outros métodos e propriedades do objeto |
| ExecuteReader() |
Executa o comando e retorna um leitor de dados.Executes the command and returns a data reader. |
| ExecuteReader(CommandBehavior) |
Compila o CommandText em uma árvore de comandos e o passa para o provedor de repositório subjacente para execução e depois cria um EntityDataReader fora do conjunto de resultados produzido usando o CommandBehavior especificado.Compiles the CommandText into a command tree and passes it to the underlying store provider for execution, then builds an EntityDataReader out of the produced result set using the specified CommandBehavior. |
| ExecuteReaderAsync() |
Uma versão assíncrona de ExecuteReader, que executa o CommandText contra o Connection e retorna um DbDataReader.An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. Invoca ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) com CancellationToken.None.Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken) with CancellationToken.None. (Herdado de DbCommand) |
| ExecuteReaderAsync(CancellationToken) |
Uma versão assíncrona de ExecuteReader, que executa o CommandText contra o Connection e retorna um DbDataReader.An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. Esse método propaga a notificação de que as operações devem ser canceladas.This method propagates a notification that operations should be canceled. Invoca ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken). (Herdado de DbCommand) |
| ExecuteReaderAsync(CommandBehavior) |
Uma versão assíncrona de ExecuteReader, que executa o CommandText contra o Connection e retorna um DbDataReader.An asynchronous version of ExecuteReader, which executes the CommandText against the Connection and returns a DbDataReader. Invoca ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken). (Herdado de DbCommand) |
| ExecuteReaderAsync(CommandBehavior, CancellationToken) |
Invoca ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken).Invokes ExecuteDbDataReaderAsync(CommandBehavior, CancellationToken). (Herdado de DbCommand) |
| ExecuteScalar() |
Executa o comando e retorna a primeira coluna da primeira linha do conjunto de resultados.Executes the command, and returns the first column of the first row in the result set. Colunas ou linhas adicionais são ignoradas.Additional columns or rows are ignored. |
| ExecuteScalarAsync() |
Uma versão assíncrona de ExecuteScalar(), que executa a consulta e retorna a primeira coluna da primeira linha no conjunto de resultados retornado pela consulta.An asynchronous version of ExecuteScalar(), which executes the query and returns the first column of the first row in the result set returned by the query. Todas as outras colunas e linhas são ignoradas.All other columns and rows are ignored. Invoca ExecuteScalarAsync(CancellationToken) com CancellationToken.None.Invokes ExecuteScalarAsync(CancellationToken) with CancellationToken.None. (Herdado de DbCommand) |
| ExecuteScalarAsync(CancellationToken) |
Essa é a versão assíncrona de ExecuteScalar().This is the asynchronous version of ExecuteScalar(). Provedores devem substituir com uma implementação apropriada.Providers should override with an appropriate implementation. Opcionalmente, o token de cancelamento pode ser ignorado.The cancellation token may optionally be ignored. A implementação padrão invoca o método ExecuteScalar() síncrono e retorna uma tarefa concluída, bloqueando o thread de chamada.The default implementation invokes the synchronous ExecuteScalar() method and returns a completed task, blocking the calling thread. A implementação padrão retornará uma tarefa cancelada se já tiver passado um token de cancelamento.The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceções geradas por ExecuteScalar serão comunicadas por meio da propriedade Exceção de Tarefa retornada.Exceptions thrown by ExecuteScalar will be communicated via the returned Task Exception property. Não invoque outros métodos e propriedades do objeto |
| GetHashCode() |
Serve como a função de hash padrão.Serves as the default hash function. (Herdado de Object) |
| GetLifetimeService() |
Obsoleto.
Recupera o objeto de serviço de tempo de vida atual que controla a política de ciclo de vida para esta instância.Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Herdado de MarshalByRefObject) |
| GetService(Type) |
Retorna um objeto que representa um serviço fornecido pelo Component ou pelo seu Container.Returns an object that represents a service provided by the Component or by its Container. (Herdado de Component) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| InitializeLifetimeService() |
Obsoleto.
Obtém um objeto de serviço de tempo de vida para controlar a política de tempo de vida para essa instância.Obtains a lifetime service object to control the lifetime policy for this instance. (Herdado de MarshalByRefObject) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| MemberwiseClone(Boolean) |
Cria uma cópia superficial do objeto MarshalByRefObject atual.Creates a shallow copy of the current MarshalByRefObject object. (Herdado de MarshalByRefObject) |
| Prepare() |
Compila o comando de nível de entidade e cria uma versão preparada do comando.Compiles the entity-level command and creates a prepared version of the command. |
| PrepareAsync(CancellationToken) |
Cria de maneira assíncrona uma versão preparada (ou compilada) do comando na fonte de dados.Asynchronously creates a prepared (or compiled) version of the command on the data source. (Herdado de DbCommand) |
| ToString() |
Retorna um String que contém o nome do Component, se houver.Returns a String containing the name of the Component, if any. Esse método não deve ser substituído.This method should not be overridden. (Herdado de Component) |
| ToTraceString() |
Compila o comando de nível de entidade e retorna o texto do comando de repositório.Compiles the entity-level command and returns the store command text. |
Eventos
| Disposed |
Ocorre quando o componente é disposto por uma chamada ao método Dispose().Occurs when the component is disposed by a call to the Dispose() method. (Herdado de Component) |
Implantações explícitas de interface
| IDbCommand.Connection |
Obtém ou define o IDbConnection usado por essa instância do IDbCommand.Gets or sets the IDbConnection used by this instance of the IDbCommand. (Herdado de DbCommand) |
| IDbCommand.CreateParameter() |
Cria uma nova instância de um objeto IDbDataParameter.Creates a new instance of an IDbDataParameter object. (Herdado de DbCommand) |
| IDbCommand.ExecuteReader() |
Executa o CommandText no Connection e compila um IDataReader.Executes the CommandText against the Connection and builds an IDataReader. (Herdado de DbCommand) |
| IDbCommand.ExecuteReader(CommandBehavior) |
Executa o CommandText para o Connection e cria um IDataReader usando um dos valores de CommandBehavior.Executes the CommandText against the Connection, and builds an IDataReader using one of the CommandBehavior values. (Herdado de DbCommand) |
| IDbCommand.Parameters |
Obtém o IDataParameterCollection.Gets the IDataParameterCollection. (Herdado de DbCommand) |
| IDbCommand.Transaction |
Obtém ou define o DbCommand em que este objeto DbTransaction é executado.Gets or sets the DbTransaction within which this DbCommand object executes. (Herdado de DbCommand) |