비슷한 문제가 발생하여 복잡한 개체를 플랫 EntityProperty
사전으로 병합하고 DynamicTableEntity
형태로 테이블 저장소에 쓸 수있게 만드는 일반 개체 flattener/recomposer API를 구현했습니다.
동일한 API는 DynamicTableEntity
의 EntityProperty
사전에서 다시 전체 복합 객체를 다시 구성합니다. https://www.nuget.org/packages/ObjectFlattenerRecomposer/
사용법 :
//Flatten complex object (of type ie. Order) and convert it to EntityProperty Dictionary
Dictionary<string, EntityProperty> flattenedProperties = EntityPropertyConverter.Flatten(order);
// Create a DynamicTableEntity and set its PK and RK
DynamicTableEntity dynamicTableEntity = new DynamicTableEntity(partitionKey, rowKey);
dynamicTableEntity.Properties = flattenedProperties;
// Write the DynamicTableEntity to Azure Table Storage using client SDK
//Read the entity back from AzureTableStorage as DynamicTableEntity using the same PK and RK
DynamicTableEntity entity = [Read from Azure using the PK and RK];
//Convert the DynamicTableEntity back to original complex object.
Order order = EntityPropertyConverter.ConvertBack<Order>(entity.Properties);
당신보다이 다른 작업을 수행하는 방법의 좋은 예를 일이 수행 http://msdn.microsoft.com/
은 보라 ko-kr/library/ff803373.aspx # sec19. 이것은 지나치게 복잡한 이럴 것 같습니다. – s1mm0t