Azure 表存储和动态表服务实体
我正在寻找一种在 Azure 表存储中创建本质上动态的对象的方法。换句话说,除了 TableServiceEntity 所需的基本属性之外,它们没有定义的公开属性的类结构。换句话说,就像一个 JSON 对象。有人做过这样的事吗?
I am looking for a way to create objects in the Azure Table Storage that are essentially dynamic in nature. In other words they have no defined class structure of exposed properties, except for the base ones required by TableServiceEntity. In other words, like a JSON object. Has anyone done something like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您希望在 .Net 代码中实现这一目标,我建议您查看 CodePlex 上的 Azure 存储资源管理器的源代码 (http://azurestorageexplorer.codeplex.com/)。我认为该类的名称是 GenericEntity。
If you're looking to achieve so in .Net code, may I suggest you take a look at the source code for Azure Storage Explorer on CodePlex (http://azurestorageexplorer.codeplex.com/). I think the name of the class is GenericEntity.
我正在开发一个允许这样做的开源客户端。
表存储服务是无模式的,但提供的 .NET 客户端不会公开它,它甚至不会模仿 REST API,因此很难遵循现有的 API 文档。
通过 Cyan,我尝试使用 .NET 提供更少“泄漏抽象”(嗨 Joel!)的服务4.动态特征。
它仍在进行中,但如果您愿意,您可以使用其中的一些代码。
I am working on an open source client that allows exactly that.
The Table Storage service is schema free but the provided .NET client does not expose it, it doesn't even mimic the REST API making very difficult to follow the existing API documentation.
With Cyan I am trying to provide a less "leaky abstraction" (hi Joel!) of the service using .NET 4 dynamic features.
It's still a work in progress, but you can use some of the code if you want.
是的,我只是在表上有一个名为“Value”的属性,我用它来存储 JSON 字符串。只要您不想在查询中使用它,它就可以很好地工作。
编辑
我创建了一个小型库,用于将动态类型(或字典)与表存储结合使用。此处可用(请参阅 DynamicTableContext):https://github.com/richorama/AzureSugar
Yes, I just had a property on the table called 'Value', which I used to store a JSON string. It works very well, as long as you don't want to use it in a query.
Edit
I have created a small library for using dynamic types (or dictionaries) with table storage. Available here (see DynamicTableContext): https://github.com/richorama/AzureSugar
我编写了一个客户端,它通过使用字典来保存名称/值对来支持动态(未指定)列。它还支持许多其他功能,例如数组、枚举和大于 64K 的数据。
您可以通过 NuGet 从 http://www.lucifure.com 下载 Lucifure Stash。
I have written an client that supports dynamic (unspecified) columns by using a dictionary to hold the name/value pairs. It also supports many other features like arrays, enums and data larger than 64K.
You can download Lucifure Stash, from http://www.lucifure.com via NuGet.