TableStorage Azure 中未知实体的 DataServiceQuery
我,
这是我的情况。
我的 Azure 中有一个辅助角色,需要不断从表存储中的表中读取行并对其执行一些操作。但问题是你不知道他在拉动哪个实体。它可以是客户、订单或任何其他实体。
那么,无论它是什么实体,如何才能提取前 100 行或全部行呢?
我正在使用的当前解决方案是为每一行提供一个“类型”列,该列描述了他是什么类型的实体。然后,我只需向表存储发出 REST 请求,获取原始 xml 并对其进行解析。我读入类型,这就是我知道该行是哪个实体的方式。
这是正确的方法还是有更好的方法?
谢谢
I,
Here is my situation.
I have a worker role in my Azure who needs to constantly read rows from a Table in tablestorage and do some actions with it. But the problem is you don't know which entity he is pulling. It could me a Customer or an Order or a any other entity.
So how can you pull like the first 100 rows or all, no mather what entity it is?
The current solution I'm working with is giving each row a 'Type' Column which describes what type of entity he is. Then I just do a REST request to my tablestorage and get the raw xml back and parse it. I read in the type and that's how I know which entity the row is.
Is this the right way or is there any better way?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案:
这对我来说是这样的:
http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/f57cb566-cc7a-4b31-b1ab-47b6d16604af/
他实现了编写方法,但经过一些调整,我成功地实现了读取未知类型并获取具有属性的字典。
Answer:
This did the thing for me:
http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/f57cb566-cc7a-4b31-b1ab-47b6d16604af/
He implemented the writing methode but with some tweaking I managed to implement reading unknowntypes and getting a dictionary with the properties.