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

EFCore 7 PrimaryKey attribute not working #54

Open
LockTar opened this issue Aug 17, 2023 · 0 comments
Open

EFCore 7 PrimaryKey attribute not working #54

LockTar opened this issue Aug 17, 2023 · 0 comments

Comments

@LockTar
Copy link

LockTar commented Aug 17, 2023

I have a class with PrimaryKey attribute for a composite key.

I see in the documentation that composite keys should work with multiple Key and Order attributes.
Primary key on multiple columns, annotated by the [Key, Column(Order = X)] attributes

Only then I got the following error when running my app:
The entity type '{Entity Here}' has multiple properties with the [Key] attribute. Composite primary keys configured by placing the [PrimaryKey] attribute on the entity type class, or by using 'HasKey' in 'OnModelCreating'.

Any change to add the PrimaryKey support?

Thanks!

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

1 participant