Skip to content

Allow annotating record constructor parameters with PartitionKey/RowKey #43

Closed
@kzu

Description

@kzu

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);

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions