共用方式為


PropertyInterceptionContext<TValue> 類別

定義

表示與類型 TValue 之屬性 setter 呼叫相關聯的內容資訊。

public class PropertyInterceptionContext<TValue> : System.Data.Entity.Infrastructure.Interception.DbInterceptionContext
type PropertyInterceptionContext<'Value> = class
    inherit DbInterceptionContext
Public Class PropertyInterceptionContext(Of TValue)
Inherits DbInterceptionContext

類型參數

TValue

目標屬性的類型。

繼承
PropertyInterceptionContext<TValue>
衍生

備註

這個類別的實例會傳遞至分派方法,而且不包含可變動的資訊,例如作業的結果。 這個可變動的資訊是從 PropertyInterceptionContext<TValue> 傳遞至攔截器的 取得。 這個類別的實例是公開不可變的。 若要新增內容資訊,請使用其中一個 With...或 ...方法來建立包含新資訊的新攔截內容。

建構函式

PropertyInterceptionContext<TValue>()

建構沒有狀態的新 PropertyInterceptionContext<TValue>

PropertyInterceptionContext<TValue>(DbInterceptionContext)

從指定的攔截內容複寫不可變狀態,以建立新的 PropertyInterceptionContext<TValue> 。 另請參閱 Clone()

屬性

DbContexts

取得與此攔截內容相關聯的所有 DbContext 實例。

(繼承來源 DbInterceptionContext)
Exception

如果在作業執行之前設定這個屬性,則會隱藏作業的執行,並改為擲回設定的例外狀況。 否則,如果作業失敗,則此屬性會設定為擲回的例外狀況。 不論是哪一種情況,在作業之後執行的攔截器都可以變更這個屬性來變更將擲回的例外狀況,或將這個屬性設定為 null,完全不會擲回任何例外狀況。

IsAsync

如果作業是以非同步方式執行,則為 True,否則為 false。

(繼承來源 DbInterceptionContext)
IsExecutionSuppressed

如果為 true,這個旗標表示其中一個攔截器已隱藏作業的執行。 呼叫 或 將 設定 Exception 為擲回 ,即可在作業執行 SuppressExecution() 之前完成此作業

ObjectContexts

取得與此攔截內容相關聯的所有 ObjectContext 實例。

(繼承來源 DbInterceptionContext)
OriginalException

如果作業執行失敗,則這個屬性會包含擲回的例外狀況。 如果作業已隱藏或未失敗,則此屬性一律為 Null。

TaskStatus

在非同步作業完成之後,設定為 的狀態 Task 。 不適用於同步作業。

UserState
已淘汰.

取得或設定值,其中包含與作業相關聯的任意使用者指定狀態資訊。

Value

將指派給目標屬性的值。

方法

AsAsync()

建立新的 PropertyInterceptionContext<TValue> ,其中包含此攔截內容中的所有內容資訊,並將 IsAsync 旗標設定為 true。

Clone()

建立攔截內容的複本以將新狀態新增至此方法時呼叫此方法。 使用此方法而不是直接呼叫建構函式可確保虛擬分派,讓新類型具有相同的類型 (,以及任何特殊狀態) 複製的內容。

Equals(Object)

表示與類型 TValue 之屬性 setter 呼叫相關聯的內容資訊。

FindUserState(String)

取得值,其中包含與作業相關聯的任意使用者指定狀態資訊。

GetHashCode()

表示與類型 TValue 之屬性 setter 呼叫相關聯的內容資訊。

GetType()

取得目前執行個體的 Type

SetUserState(String, Object)

設定值,其中包含與作業相關聯的任意使用者指定狀態資訊。

SuppressExecution()

防止在作業執行之前呼叫 時執行作業。

ToString()

表示與類型 TValue 之屬性 setter 呼叫相關聯的內容資訊。

WithDbContext(DbContext)

建立新的 PropertyInterceptionContext<TValue> ,其中包含這個攔截內容中的所有內容資訊,並加上指定的 ObjectContext

WithObjectContext(ObjectContext)

建立新的 PropertyInterceptionContext<TValue> ,其中包含這個攔截內容中的所有內容資訊,並加上指定的 ObjectContext

WithValue(TValue)

建立新的 BeginTransactionInterceptionContext ,其中包含這個攔截內容中的所有內容資訊,以及指定的屬性值。

適用於