diff --git a/CoreHelpers.WindowsAzure.Storage.Table/Serialization/TableEntityDynamic.cs b/CoreHelpers.WindowsAzure.Storage.Table/Serialization/TableEntityDynamic.cs index 503dce5..64459e6 100644 --- a/CoreHelpers.WindowsAzure.Storage.Table/Serialization/TableEntityDynamic.cs +++ b/CoreHelpers.WindowsAzure.Storage.Table/Serialization/TableEntityDynamic.cs @@ -56,12 +56,19 @@ internal static class TableEntityDynamic // create the target model var model = new T(); + // get all properties from model IEnumerable objectProperties = model.GetType().GetTypeInfo().GetProperties(); // visit all properties foreach (PropertyInfo property in objectProperties) { + if (property.Name == entityMapper.PartitionKeyFormat && property.SetMethod != null) + property.SetValue(model, entity.PartitionKey); + + if (property.Name == entityMapper.RowKeyFormat && property.SetMethod != null) + property.SetValue(model, entity.RowKey); + if (ShouldSkipProperty(property)) continue;