I am a C# .net developer and I am creating an email tracking system. I want to store my data to the Azure Table Storage, but I want to create all the entities in the same partition with different row key. My properties key are same but the value is different. For example:
partition key = "Test+id"
row key=123
properties:
subject:"Hello",
from:"[email protected]",
to:"[email protected]",
body:"Hello I am a test email"
Now I want to create a copy of above, but with different rowKey value, same Partition key-value and same property key but with different value. Like this:
partition key = "Test+id",
row key="787",
properties:
subject: "HelloTesting",
from:"[email protected]",
to:"[email protected]",
body: "Hello I am a test email2, this is so nice"
Here is the C# code that I am using to add the properties:
foreach (KeyValuePair<string, string> keyValuePair in list)
{
dynamicTableEntity.RowKey = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.SSS");
Console.WriteLine(keyValuePair.Key);
if (keyValuePair.Key.Equals("subject"))
{
dynamicTableEntity.Properties.Add("subject", EntityProperty.CreateEntityPropertyFromObject(keyValuePair.Value));
}
else if (keyValuePair.Key.Equals("toRecipients") )
{
dynamicTableEntity.Properties.Add("toRecipients", EntityProperty.CreateEntityPropertyFromObject(keyValuePair.Value));
}
else if (keyValuePair.Key.Equals("from") )
{
dynamicTableEntity.Properties.Add("from", EntityProperty.CreateEntityPropertyFromObject(keyValuePair.Value));
}
else if (keyValuePair.Key.Equals("bodyPreview") )
{
dynamicTableEntity.Properties.Add("bodyPreview", EntityProperty.CreateEntityPropertyFromObject(keyValuePair.Value));
}
else
{
dynamicTableEntity.Properties.Add(keyValuePair.Key, EntityProperty.CreateEntityPropertyFromObject(keyValuePair.Value));
}
}
Any help would be appreciated.