Working with untyped entities in the Table Storage Service

added by sandrino
11/16/2012 2:59:04 AM

0 Kicks, 68 Views

Taking a deeper look TableEntity You’ll see a few changes compared to the old TableServiceEntity class: •The ETag property was added •The Timestamp is now a DateTimeOffset (much better for working with different timezones) •2 new virtual methods: ReadEntity and WriteEntity By default, these methods are implemented as follows: •ReadEntity: Will use reflection to get a list of all properties for the current entity type. Then it will try to map the values received in the properties parameter and try to map the values. •WriteEntity: Will use reflection to get the values of each property and add all these values to a dictionary. As you can see, both of these methods can come in handy if you want to do something a little more advanced. Let’s see how easy it is to create a new TableEntity which acts like a dictionary.