Class DynamicTableEntity
- Namespace
- Microsoft.WindowsAzure.Storage.Table
- Assembly
- Microsoft.WindowsAzure.Storage.dll
A ITableEntity type which allows callers direct access to the property map of the entity. This class eliminates the use of reflection for serialization and deserialization.
public sealed class DynamicTableEntity : ITableEntity
- Inheritance
-
DynamicTableEntity
- Implements
- Inherited Members
Constructors
DynamicTableEntity()
Initializes a new instance of the DynamicTableEntity class.
public DynamicTableEntity()
DynamicTableEntity(string, string)
Initializes a new instance of the DynamicTableEntity class with the specified partition key and row key.
public DynamicTableEntity(string partitionKey, string rowKey)
Parameters
partitionKey
stringA string containing the partition key value for the entity.
rowKey
stringA string containing the row key value for the entity.
DynamicTableEntity(string, string, string, IDictionary<string, EntityProperty>)
Initializes a new instance of the DynamicTableEntity class with the entity's partition key, row key, ETag (if available/required), and properties.
public DynamicTableEntity(string partitionKey, string rowKey, string etag, IDictionary<string, EntityProperty> properties)
Parameters
partitionKey
stringA string containing the partition key value for the entity.
rowKey
stringA string containing the row key value for the entity.
etag
stringA string containing the ETag for the entity.
properties
IDictionary<string, EntityProperty>An IDictionary<TKey, TValue> object containing the entity's properties, indexed by property name.
Properties
ETag
Gets or sets the entity's current ETag.
public string ETag { get; set; }
Property Value
- string
A string containing the ETag for the entity.
Remarks
Set this value to '*' to blindly overwrite an entity as part of an update operation.
this[string]
Gets or sets the entity's property, given the name of the property.
public EntityProperty this[string key] { get; set; }
Parameters
key
stringA string containing the name of the property.
Property Value
- EntityProperty
An EntityProperty object.
PartitionKey
Gets or sets the entity's partition key.
public string PartitionKey { get; set; }
Property Value
- string
A string containing the partition key value for the entity.
Properties
Gets or sets the properties in the table entity, indexed by property name.
public IDictionary<string, EntityProperty> Properties { get; set; }
Property Value
- IDictionary<string, EntityProperty>
An IDictionary<TKey, TValue> object containing the entity's properties.
RowKey
Gets or sets the entity's row key.
public string RowKey { get; set; }
Property Value
- string
A string containing the row key value for the entity.
Timestamp
Gets or sets the entity's timestamp.
public DateTimeOffset Timestamp { get; set; }
Property Value
- DateTimeOffset
A DateTimeOffset containing the timestamp for the entity.
Methods
ReadEntity(IDictionary<string, EntityProperty>, OperationContext)
Deserializes this DynamicTableEntity instance using the specified IDictionary<TKey, TValue> of property names to values of type EntityProperty.
public void ReadEntity(IDictionary<string, EntityProperty> properties, OperationContext operationContext)
Parameters
properties
IDictionary<string, EntityProperty>A collection containing the IDictionary<TKey, TValue> of string property names mapped to values of type EntityProperty to store in this DynamicTableEntity instance.
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Remarks
The properties dictionary passed to this API is stored internally as a reference, not a copy.
WriteEntity(OperationContext)
Serializes the IDictionary<TKey, TValue> of property names mapped to values of type EntityProperty from this DynamicTableEntity instance.
public IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext)
Parameters
operationContext
OperationContextAn OperationContext object that represents the context for the current operation.
Returns
- IDictionary<string, EntityProperty>
An IDictionary<TKey, TValue> object containing the map of string property names to values of type EntityProperty stored in this DynamicTableEntity instance.