我在Azure上成功检索表行:
TableOperation operation = TableOperation.Retrieve<MyEntity>(partitionKey, rowkey);
TableResult result = table.Execute(operation);
if (result.Result != null)
{
}
我需要查看结果,看看MyEntity.MyProperty == true
我无法查看实际的MyEntity结果,例如
log.Info(result.Result);
返回Submission#0+MyEntity
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
使用TableResult,如何查看属性?
答案 0 :(得分:1)
只需将result.Result
投射到您的实体类:
((MyEntity)result.Result).MyProperty