Azure功能:使用TableResult,如何查看属性?

时间:2018-02-09 10:33:27

标签: azure azure-functions azure-table-storage

我在Azure上成功检索表行:

TableOperation operation = TableOperation.Retrieve<MyEntity>(partitionKey, rowkey);
TableResult result  = table.Execute(operation);

if (result.Result != null)
{
}

我需要查看结果,看看MyEntity.MyProperty == true

我无法查看实际的MyEntity结果,例如

  1. log.Info(result.Result);返回Submission#0+MyEntity

  2. log.Info(result.Result.MyProperty) : object does not contain a definition for MyProperty and no extension method MyProperty accepting a first argument of type 'object' could be found

  3. 使用TableResult,如何查看属性?

1 个答案:

答案 0 :(得分:1)

只需将result.Result投射到您的实体类:

((MyEntity)result.Result).MyProperty
相关问题