Skip to content

Commit 4abd2ea

Browse files
committed
Add documentation for record annotations
1 parent 69390f5 commit 4abd2ea

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

readme.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,24 @@ entity type to modify the default values used:
196196

197197
Values passed to the factory methods override declarative attributes.
198198

199+
For the products example above, your record entity could be:
200+
201+
```csharp
202+
[Table("Products")]
203+
public record Product([PartitionKey] string Category, [RowKey] string Id)
204+
{
205+
public string? Title { get; init; }
206+
public double Price { get; init; }
207+
}
208+
```
209+
210+
And creating the repository wouldn't require any arguments besides the storage account:
211+
212+
```csharp
213+
var repo = TableRepository.Create<Product>(CloudStorageAccount.DevelopmentStorageAccount);
214+
```
215+
216+
199217
### TableEntity Support
200218

201219
Since these repository APIs are quite a bit more intuitive than working directly against a

0 commit comments

Comments
 (0)