简体   繁体   English

Azure表:在不创建特定类或不了解整个架构的情况下进行获取

[英]Azure table : Fetch without create a specific class or knowing the whole schema

I have a table "constants" with a specific shema like : 我有一个表“常量”,具有特定的shema,如:
PartitionKey, RowKey, Timestamp, ARG1, ARG2, ARG3 分区键,行键,时间戳,ARG1,ARG2,ARG3

for example these entities: 例如,这些实体:
production, 0, 01/01/2012, L, 5, 7 生产,0,01/01/2012,L,5,7
production, 1, 01/01/2012, F, 7, 7 生产,1,01/01/2012,F,7,7

Can I fetch an entity without create a class ? 我可以在不创建类的情况下获取实体吗?
Something as: 如:

var query = MagicFunctionWichGiveAEntity("production", "0"); //0 is the RowKey  
var result = query.ValueOf("ARG1") // result = L  

I found this post but it look like complicated. 我发现了这篇文章,但看起来很复杂。

The only way to do this is with the ReadingEntity event (as described in the post you reference). 做到这一点的唯一方法是使用ReadingEntity事件(如您所引用的文章中所述)。 If you want to see a fully working implementation I suggest you take a look at the Storage Services Smart Client located here: http://archive.msdn.microsoft.com/appfabriccat/Release/ProjectReleases.aspx?ReleaseId=5474 如果您希望看到一个完全正常的实现,建议您看一下位于以下位置的Storage Services Smart Clienthttp : //archive.msdn.microsoft.com/appfabriccat/Release/ProjectReleases.aspx?ReleaseId=5474

You'll need to look at the files: 您需要查看以下文件:

  • Client\\Helpers\\CloudStorageHelper.cs 客户端\\助手\\ CloudStorageHelper.cs
  • Client\\Helpers\\ConversionHelper.cs 客户端\\助手\\ ConversionHelper.cs
  • Client\\Helpers\\CustomEntity.cs 客户端\\助手\\ CustomEntity.cs

An alternative solution would be to interact directly with the REST API where you can get an entity in XML format: http://msdn.microsoft.com/en-us/library/windowsazure/dd179421 一种替代解决方案是直接与REST API交互,您可以在其中获得XML格式的实体: http : //msdn.microsoft.com/zh-cn/library/windowsazure/dd179421

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, enumerations and data larger than 64K. 它还支持许多其他功能,例如数组,枚举和大于64K的数据。

It is available free for personal use. 它可供个人免费使用。 You can get it at http://www.lucifure.com or via NuGet.com. 您可以从http://www.lucifure.com或通过NuGet.com获得它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在不知道底层架构的情况下进行 Microsoft Bond 反序列化 - Microsoft Bond deserialization without knowing underlying schema 使用ExecuteStoreQuery从数据库中获取行,而无需了解表中的列数 - Fetch rows from database using ExecuteStoreQuery, without knowing the number of columns in the table 如何在整个应用程序中创建和注入用户特定的 singleton class? - How to create and inject a user specific singleton class throughout the whole application? 在不知道背后类的情况下获取 C# 中特定对象属性的值 - Get value of a specific object property in C# without knowing the class behind 与天蓝色的经纪人消息不知道类型的身体 - with azure brokeredmessage get the body without knowing the type 在不知道用户名的情况下获取用户特定的路径 - Getting a user specific path without knowing the username 在不知道对象类型(类/表)的情况下查询实体框架实体 - Query an Entity Framework entity without knowing the object type (class/table) in advance 如何在不提前知道目标名称空间的情况下加载架构? - How to load a schema without knowing the target namespace ahead of time? 在不知道类型的情况下传递类的实例 - Passing instances of a class without knowing the Type 如何在不知道 class 的情况下在库中获取 dbcontext - How to get dbcontext in the library without knowing the class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM