DbRawSqlQuery<TElement>.LongCountAsync 方法
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
非同步傳回 Int64,表示查詢中的項目總數。
命名空間: System.Data.Entity.Infrastructure
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
Public Function LongCountAsync As Task(Of Long)
'用途
Dim instance As DbRawSqlQuery
Dim returnValue As Task(Of Long)
returnValue = instance.LongCountAsync()
public Task<long> LongCountAsync()
public:
Task<long long>^ LongCountAsync()
member LongCountAsync : unit -> Task<int64>
public function LongCountAsync() : Task<long>
傳回值
類型:System.Threading.Tasks.Task<Int64>
表示非同步作業的工作。工作結果包含查詢結果中的項目數。
例外狀況
例外狀況 | 條件 |
---|---|
OverflowException | 查詢結果中的項目數大於 MaxValue。 |
備註
不支援相同內容執行個體上的多個作用中作業。 使用 'await' 確保在此內容上呼叫另一個方法之前,所有非同步作業都已完成。