DbCommandInterceptor.ScalarExecuted 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
EF打電話 ExecuteScalar()後立刻打電話。
即使攔截器抑制了在 中的 ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>)指令執行,此方法仍會被呼叫。
此時, result 是由 ScalarExecuting(DbCommand, CommandEventData, InterceptionResult<Object>)返回的結果。
public virtual object? ScalarExecuted(System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object? result);
public virtual object ScalarExecuted(System.Data.Common.DbCommand command, Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData eventData, object result);
abstract member ScalarExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj -> obj
override this.ScalarExecuted : System.Data.Common.DbCommand * Microsoft.EntityFrameworkCore.Diagnostics.CommandExecutedEventData * obj -> obj
Public Overridable Function ScalarExecuted (command As DbCommand, eventData As CommandExecutedEventData, result As Object) As Object
參數
- command
- DbCommand
命令。
- eventData
- CommandExecutedEventData
關於指令與執行的上下文資訊。
- result
- Object
呼叫 的 ExecuteScalar()結果。 此值通常用作此方法實作的回傳值。
傳回
EF 將採用的結果。
對於任何不嘗試更改結果的攔截器,這種方法的正常實作是回傳 result 傳入的值。