Allow annotating record constructor parameters with PartitionKey/RowKey
kzu opened this issue · comments
Daniel Cazzulino commented
When using C# 9 records for storage (super convenient!), you typically don't declare the properties explicitly, but leverage the concise syntax instead:
public record Book(string ISBN, string Author, string Title);
Since you don't have a property to place the PartitionKey
and RowKey
attributes, you need to instead provide them via lambdas on every creation of a table partition or repository.
It would be nice if we could allow the attributes in the record constructor arguments themselves:
public record Book([RowKey] string ISBN, [PartitionKey] string Author, string Title);