Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow annotating record constructor parameters with PartitionKey/RowKey #43

Closed
kzu opened this issue Jun 23, 2021 · 0 comments · Fixed by #44
Closed

Allow annotating record constructor parameters with PartitionKey/RowKey #43

kzu opened this issue Jun 23, 2021 · 0 comments · Fixed by #44
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Jun 23, 2021

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

@kzu kzu added the enhancement New feature or request label Jun 23, 2021
kzu added a commit that referenced this issue Jun 23, 2021
When using C# 9 records for storage (super convenient!), you typically don't declare the properties explicitly, but leverage the concise syntax instead, so now you can do:

```
public record Book([RowKey] string ISBN, [PartitionKey] string Author, string Title);
```

Fixes #43
@kzu kzu closed this as completed in #44 Jun 23, 2021
kzu added a commit that referenced this issue Jun 23, 2021
When using C# 9 records for storage (super convenient!), you typically don't declare the properties explicitly, but leverage the concise syntax instead, so now you can do:

```
public record Book([RowKey] string ISBN, [PartitionKey] string Author, string Title);
```

Fixes #43
@devlooped devlooped locked and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant