@@ -222,7 +222,7 @@ it with `[Browsable(false)]` and it will be skipped when persisting and reading
222222Since these repository APIs are quite a bit more intuitive than working directly against a
223223` TableClient ` , you might want to retrieve/enumerate entities just by their built-in ` ITableEntity `
224224properties, like ` PartitionKey ` , ` RowKey ` , ` Timestamp ` and ` ETag ` . For this scenario, we
225- also support creating ` ITableRepository<TableEntity > ` and ` ITablePartition<TableEntity > `
225+ also support creating ` ITableRepository<ITableEntity > ` and ` ITablePartition<ITableEntity > `
226226by using the factory methods ` TableRepository.Create(...) ` and ` TablePartition.Create(...) `
227227without a (generic) entity type argument.
228228
@@ -236,10 +236,26 @@ var repo = TablePartition.Create(storageAccount,
236236 partitionKey : " Region" );
237237
238238// Enumerate all regions within the partition as plain TableEntities
239- await foreach (TableEntity region in repo .EnumerateAsync ())
239+ await foreach (ITableEntity region in repo .EnumerateAsync ())
240240 Console .WriteLine (region .RowKey );
241241```
242242
243+ Moverover, the returned ` ITableEntity ` is actually an instance of ` DynamicTableEntity ` , so
244+ you can downcast and access any additional stored properties, which you can persist by
245+ passing a ` DynamicTableEntity ` to ` PutAsync ` :
246+
247+ ``` csharp
248+ await repo .PutAsync (new DynamicTableEntity (" Book" , " 9781473217386" , " *" , new Dictionary <string , EntityProperty >
249+ {
250+ { " Title" , EntityProperty .GeneratePropertyForString (" Neuromancer" ) },
251+ { " Price" , EntityProperty .GeneratePropertyForDouble (7 . 32 ) },
252+ }));
253+
254+ var entity = (DynamicTableEntity )await repo .GetAsync (" Book" , " 9781473217386" );
255+
256+ Assert .Equal (" Title" , entity .Properties [" Neuromancer" ].StringValue );
257+ Assert .Equal (7 . 32 , entity .Properties [" Price" ].DoubleValue );
258+ ```
243259
244260## Installation
245261
0 commit comments