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

Mapping attribute to create alternate keys #23153

Open
ajcvickers opened this issue Oct 30, 2020 · 4 comments
Open

Mapping attribute to create alternate keys #23153

ajcvickers opened this issue Oct 30, 2020 · 4 comments

Comments

@ajcvickers
Copy link
Member

Ultimately this will create a unique column (or group of columns) in the database which may or may not be used as the principal end of a relationship. In other words, it's a way to make a non-primary key column have a unique constraint without explicitly specifying a unique index.

This is not technically blocked on #4073, but should probably not be implemented until #4073 is fixed.

@ajcvickers ajcvickers added area-model-building type-enhancement good first issue This issue should be relatively straightforward to fix. labels Oct 30, 2020
@ajcvickers ajcvickers added this to the Backlog milestone Oct 30, 2020
@firmanalams
Copy link

I'm interested in working on this issue.

@ajcvickers
Copy link
Member Author

@alam157 That's great! Do you have a use-case for this? Even the fluent API here is very rarely needed.

@firmanalams
Copy link

Yes i have, so i need to create attribute [Unique] right?

@ajcvickers
Copy link
Member Author

@firmanalams There is already an attribute for creating unique indexes: https://learn.microsoft.com/en-us/ef/core/modeling/indexes?tabs=data-annotations#index-uniqueness

This issue is about creating an alternate key in the EF model, which causes the model to have additional constraints over just using a unique index.

@ajcvickers ajcvickers removed the good first issue This issue should be relatively straightforward to fix. label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants