Share via


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

TableClient.GetEntityIfExistsAsync<T> 方法

定义

获取类型的 T指定表实体。

public virtual System.Threading.Tasks.Task<Azure.NullableResponse<T>> GetEntityIfExistsAsync<T> (string partitionKey, string rowKey, System.Collections.Generic.IEnumerable<string> select = default, System.Threading.CancellationToken cancellationToken = default) where T : class, Azure.Data.Tables.ITableEntity;
abstract member GetEntityIfExistsAsync : string * string * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.NullableResponse<'T>> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
override this.GetEntityIfExistsAsync : string * string * seq<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.NullableResponse<'T>> (requires 'T : null and 'T :> Azure.Data.Tables.ITableEntity)
Public Overridable Function GetEntityIfExistsAsync(Of T As {Class, ITableEntity}) (partitionKey As String, rowKey As String, Optional select As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of NullableResponse(Of T))

类型参数

T

实现 ITableEntity 或 实例的 TableEntity自定义模型类型。

参数

partitionKey
String

标识表实体的 partitionKey。

rowKey
String

标识表实体的 rowKey。

select
IEnumerable<String>

选择要在结果集中返回的实体属性集。 传递 null 以检索所有属性。

cancellationToken
CancellationToken

控制 CancellationToken 请求生存期的 。

返回

如果 NullableResponse<T> 实体存在,其 HasValue 属性将返回 true ,否则为 false

例外

发生意外错误时引发异常。

partitionKeyrowKey 为 null。

适用于