@@ -227,9 +227,9 @@ it with `[Browsable(false)]` and it will be skipped when persisting and reading
227227### TableEntity Support
228228
229229Since these repository APIs are quite a bit more intuitive than working directly against a
230- ` TableClient ` , you might want to retrieve/enumerate entities just by their built-in ` ITableEntity `
230+ ` TableClient ` , you might want to retrieve/enumerate entities just by their built-in ` TableEntity `
231231properties, like ` PartitionKey ` , ` RowKey ` , ` Timestamp ` and ` ETag ` . For this scenario, we
232- also support creating ` ITableRepository<ITableEntity > ` and ` ITablePartition<ITableEntity > `
232+ also support creating ` ITableRepository<TableEntity > ` and ` ITablePartition<TableEntity > `
233233by using the factory methods ` TableRepository.Create(...) ` and ` TablePartition.Create(...) `
234234without a (generic) entity type argument.
235235
@@ -243,25 +243,25 @@ var repo = TablePartition.Create(storageAccount,
243243 partitionKey : " Region" );
244244
245245// Enumerate all regions within the partition as plain TableEntities
246- await foreach (ITableEntity region in repo .EnumerateAsync ())
246+ await foreach (TableEntity region in repo .EnumerateAsync ())
247247 Console .WriteLine (region .RowKey );
248248```
249249
250- Moverover, the returned ` ITableEntity ` is actually an instance of ` DynamicTableEntity ` , so
251- you can downcast and access any additional stored properties, which you can persist by
252- passing a ` DynamicTableEntity ` to ` PutAsync ` :
250+ You can access and add additional properties by just using the entity indexer, which you can
251+ later persist by calling ` PutAsync ` :
253252
254253``` csharp
255- await repo .PutAsync (new DynamicTableEntity (" Book" , " 9781473217386" , " *" , new Dictionary <string , EntityProperty >
256- {
257- { " Title" , EntityProperty .GeneratePropertyForString (" Neuromancer" ) },
258- { " Price" , EntityProperty .GeneratePropertyForDouble (7 . 32 ) },
259- }));
254+ await repo .PutAsync (
255+ new TableEntity (" Book" , " 9781473217386" )
256+ {
257+ [" Title" ] = " Neuromancer" ,
258+ [" Price" ] = 7 . 32
259+ });
260260
261- var entity = ( DynamicTableEntity ) await repo .GetAsync (" Book" , " 9781473217386" );
261+ var entity = await repo .GetAsync (" Book" , " 9781473217386" );
262262
263- Assert .Equal (" Title " , entity . Properties [ " Neuromancer " ]. StringValue );
264- Assert .Equal (7 . 32 , entity . Properties [" Price" ]. DoubleValue );
263+ Assert .Equal (" Neuromancer " , entity [ " Title " ] );
264+ Assert .Equal (7 . 32 , ( double ) entity [" Price" ]);
265265```
266266
267267## Installation
0 commit comments