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

Add StronglyTypedId<T> generic attribute for C# 11+ #129

Closed
kzu opened this issue Jan 31, 2024 · 2 comments
Closed

Add StronglyTypedId<T> generic attribute for C# 11+ #129

kzu opened this issue Jan 31, 2024 · 2 comments

Comments

@kzu
Copy link

kzu commented Jan 31, 2024

Now that C# (11+) supports generic attributes, it would be nice to be able to annotate a type with the generic version to specify the backing type:

[StronglyTypedId<int>]
public partial struct UserId { }
@andrewlock
Copy link
Owner

Thanks for the suggestion, but unfortunately this won't work with the new design. The backing type isn't an unconstrained type, it's one of a specific enum values, or a string. This was discussed further in #102.

@kzu
Copy link
Author

kzu commented Feb 14, 2024

Hm, it's kinda losing its original simplicity-focused approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants