共用方式為


DbCommandDispatcher.ScalarAsync 方法

定義

public virtual System.Threading.Tasks.Task<object> ScalarAsync(System.Data.Common.DbCommand command, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext interceptionContext, System.Threading.CancellationToken cancellationToken);
abstract member ScalarAsync : System.Data.Common.DbCommand * System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
override this.ScalarAsync : System.Data.Common.DbCommand * System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>

參數

command
DbCommand

執行作業的命令。

interceptionContext
DbCommandInterceptionContext

所要呼叫內容的選擇性資訊。

cancellationToken
CancellationToken

非同步作業的解除標記。

傳回

作業的結果,可能已被攔截器修改。

備註

請注意,這個方法會傳回執行命令的結果。 在傳遞至此方法的攔截內容中無法使用結果,因為攔截內容會在傳遞至攔截器之前先複製。

適用於