Created
November 15, 2012 22:21
-
-
Save sandrinodimattia/4081803 to your computer and use it in GitHub Desktop.
DictionaryTableEntity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DictionaryTableEntity : TableEntity, IDictionary<string, EntityProperty> | |
{ | |
private IDictionary<string, EntityProperty> _properties; | |
public DictionaryTableEntity() | |
{ | |
_properties = new Dictionary<string, EntityProperty>(); | |
} | |
public override void ReadEntity(IDictionary<string, EntityProperty> properties, OperationContext operationContext) | |
{ | |
this._properties = properties; | |
} | |
public override IDictionary<string, EntityProperty> WriteEntity(OperationContext operationContext) | |
{ | |
return _properties; | |
} | |
public void Add(string key, EntityProperty value) | |
{ | |
_properties.Add(key, value); | |
} | |
public void Add(string key, bool value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, byte[] value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, DateTime? value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, DateTimeOffset? value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, double value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, Guid value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, int value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, long value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
public void Add(string key, string value) | |
{ | |
_properties.Add(key, new EntityProperty(value)); | |
} | |
// IDirectory implementation ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment