EntityKey.EntityNotValidKey 欄位

定義

簡單的 EntityKey,可識別失敗 TREAT 作業所產生的實體。

public: static initonly System::Data::EntityKey ^ EntityNotValidKey;
public static readonly System.Data.EntityKey EntityNotValidKey;
 staticval mutable EntityNotValidKey : System.Data.EntityKey
Public Shared ReadOnly EntityNotValidKey As EntityKey 

欄位值

備註

取得無效實體的方式有許多種。 最常見的案例是當 Entity SQL 查詢使用 TREAT 運算符將多型類型的實例解譯為特定類型,且有問題的實例不相符時。 (TREAT 類似於 C# as 運算子) 。 在此情況中,查詢會傳回無效的實體,而且產生之實體的實體索引鍵會設定為 EntityNotValidKey

適用於