EntityCommand 類別
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
類別,表示概念層的命令
繼承階層
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Data.Common.DbCommand
System.Data.Entity.Core.EntityClient.EntityCommand
命名空間: System.Data.Entity.Core.EntityClient
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
Public Class EntityCommand _
Inherits DbCommand
'用途
Dim instance As EntityCommand
public class EntityCommand : DbCommand
public ref class EntityCommand : public DbCommand
type EntityCommand =
class
inherit DbCommand
end
public class EntityCommand extends DbCommand
EntityCommand 類型會公開下列成員。
建構函式
名稱 | 描述 | |
---|---|---|
EntityCommand() | 使用指定的值,初始化 EntityCommand 類別的新執行個體。 | |
EntityCommand(String) | 使用指定的陳述式,初始化 EntityCommand 類別的新執行個體。 | |
EntityCommand(String, EntityConnection) | 使用指定的陳述式和連接,初始化 EntityCommand 類別的新執行個體。 | |
EntityCommand(String, EntityConnection, EntityTransaction) | 使用指定的陳述式、連接和交易,初始化 EntityCommand 類別的新執行個體。 | |
EntityCommand(String, EntityConnection, IDbDependencyResolver) | 使用給定的 eSQL 陳述式和要使用的連接物件,建構 EntityCommand 物件 |
靠上
屬性
名稱 | 描述 | |
---|---|---|
CanRaiseEvents | (繼承自 Component)。 | |
CommandText | 取得或設定 Entity SQL 陳述式 (Statement),此陳述式會指定要執行的命令或預存程序 (Stored Procedure)。 (覆寫 DbCommand.CommandText。) | |
CommandTimeout | 取得或設定在逾時之前要等待的時間。 (覆寫 DbCommand.CommandTimeout。) | |
CommandTree | 取得或設定要執行的命令樹,只能設定命令樹或命令文字中的其中一個,無法設定兩者。 | |
CommandType | 取得或設定值,此值表示如何解譯 CommandText 屬性。 (覆寫 DbCommand.CommandType。) | |
Connection | 取得或設定 EntityCommand 所使用的 EntityConnection。 | |
Container | (繼承自 Component)。 | |
DbConnection | 用於執行命令的連接物件 (覆寫 DbCommand.DbConnection。) | |
DbParameterCollection | 此命令的參數集合 (覆寫 DbCommand.DbParameterCollection。) | |
DbTransaction | 此命令執行所在的交易 (覆寫 DbCommand.DbTransaction。) | |
DesignMode | (繼承自 Component)。 | |
DesignTimeVisible | 取得或設定值,此值表示在 Windows Form 設計工具控制項中是否應該看得到命令物件。 (覆寫 DbCommand.DesignTimeVisible。) | |
EnablePlanCaching | 取得或設定值,指出查詢計畫快取是否已啟用。 | |
Events | (繼承自 Component)。 | |
Parameters | 取得 Entity SQL 陳述式或預存程序的參數。 | |
Site | (繼承自 Component)。 | |
Transaction | 取得或設定 SqlCommand 執行所在的交易。 | |
UpdatedRowSource | 取得或設定命令結果套用至要更新之資料列的方式。 (覆寫 DbCommand.UpdatedRowSource。) |
靠上
方法
名稱 | 描述 | |
---|---|---|
Cancel | 取消執行 EntityCommand。 (覆寫 DbCommand.Cancel()。) | |
CreateDbParameter | 建立並傳回新參數物件,代表 eSQL 陳述式中的參數 (覆寫 DbCommand.CreateDbParameter()。) | |
CreateObjRef | 安全性關鍵。 (繼承自 MarshalByRefObject)。 | |
CreateParameter | 建立 EntityParameter 物件的新執行個體。 | |
Dispose() | (繼承自 Component)。 | |
Dispose(Boolean) | (繼承自 Component)。 | |
Equals | (繼承自 Object)。 | |
ExecuteDbDataReader | 執行命令並傳回讀取結果的資料讀取器 (覆寫 DbCommand.ExecuteDbDataReader(CommandBehavior)。) | |
ExecuteDbDataReaderAsync | 非同步執行命令並傳回讀取結果的資料讀取器 (覆寫 DbCommandExecuteDbDataReaderAsync(CommandBehavior, CancellationToken)。) | |
ExecuteNonQuery | 執行目前的命令。 (覆寫 DbCommand.ExecuteNonQuery()。) | |
ExecuteNonQueryAsync | (繼承自 DbCommand)。 | |
ExecuteNonQueryAsync(CancellationToken) | 非同步執行命令並捨棄命令傳回的任何結果 (覆寫 DbCommandExecuteNonQueryAsync(CancellationToken)。) | |
ExecuteReader() | 執行命令並傳回資料讀取器。 | |
ExecuteReader(CommandBehavior) | 將 CommandText 編譯成命令樹,並將其傳遞至基礎存放區提供者來執行,然後使用指定的 CommandBehavior,從產生的結果集中建置 EntityDataReader。 | |
ExecuteReaderAsync() | 非同步執行命令並傳回讀取結果的資料讀取器。只能在 CommandType.CommandText 上呼叫 (否則,請使用標準 Execute* 方法) | |
ExecuteReaderAsync(CommandBehavior) | 非同步執行命令並傳回讀取結果的資料讀取器。只能在 CommandType.CommandText 上呼叫 (否則,請使用標準 Execute* 方法) | |
ExecuteReaderAsync(CancellationToken) | 非同步執行命令並傳回讀取結果的資料讀取器。只能在 CommandType.CommandText 上呼叫 (否則,請使用標準 Execute* 方法) | |
ExecuteReaderAsync(CommandBehavior, CancellationToken) | 非同步執行命令並傳回讀取結果的資料讀取器。只能在 CommandType.CommandText 上呼叫 (否則,請使用標準 Execute* 方法) | |
ExecuteScalar | 執行命令,並傳回結果集中第一個資料列的第一個資料行。會忽略其他的資料行或資料列。 (覆寫 DbCommand.ExecuteScalar()。) | |
ExecuteScalarAsync | (繼承自 DbCommand)。 | |
ExecuteScalarAsync(CancellationToken) | (繼承自 DbCommand)。 | |
Finalize | (繼承自 Component)。 | |
GetHashCode | (繼承自 Object)。 | |
GetLifetimeService | 安全性關鍵。 (繼承自 MarshalByRefObject)。 | |
GetService | (繼承自 Component)。 | |
GetType | (繼承自 Object)。 | |
InitializeLifetimeService | 安全性關鍵。 (繼承自 MarshalByRefObject)。 | |
MemberwiseClone() | (繼承自 Object)。 | |
MemberwiseClone(Boolean) | (繼承自 MarshalByRefObject)。 | |
Prepare | 編譯實體層級命令,並建立命令的備製版本。 (覆寫 DbCommand.Prepare()。) | |
ToString | (繼承自 Component)。 | |
ToTraceString | 編譯實體層級命令並傳回存放區命令文字。 |
靠上
事件
名稱 | 描述 | |
---|---|---|
Disposed | (繼承自 Component)。 |
靠上
明確介面實作
名稱 | 描述 | |
---|---|---|
IDbCommand.Connection | (繼承自 DbCommand)。 | |
IDbCommand.CreateParameter | (繼承自 DbCommand)。 | |
IDbCommand.ExecuteReader() | (繼承自 DbCommand)。 | |
IDbCommand.ExecuteReader(CommandBehavior) | (繼承自 DbCommand)。 | |
IDbCommand.Parameters | (繼承自 DbCommand)。 | |
IDbCommand.Transaction | (繼承自 DbCommand)。 |
靠上
執行緒安全
這個類型的任何 Public static (在 Visual Basic 中為 Shared) 成員都是安全執行緒。並非所有的執行個體成員都是安全執行緒。