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

Error using case-mismatched mapped properties in many to many relationship #23516

Closed
gbreen12 opened this issue Nov 27, 2020 · 2 comments
Closed
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Milestone

Comments

@gbreen12
Copy link

I have a many to many table configured in my code as:

modelBuilder.Entity<SystemUser>()
                .HasMany(x => x.LogBooks)
                .WithMany(x => x.SystemUsers)
                .UsingEntity(x =>
                {
                    x.ToTable("LogBookSystemUsers", "LogBooks");
                });

When I try to access the property, it tells me LogBookID is not found, which is correct because in the DB the column name is LogBookId (notice the caps). Same for the SystemUserID and SystemUserId. How can I tell EF Core the name of the columns?

@gbreen12
Copy link
Author

This stack overflow question claims it's a bug and what I have should work:

https://stackoverflow.com/questions/65043926/entity-framework-core-many-to-many-change-navigation-property-names/65046246#65046246

@ajcvickers
Copy link
Contributor

/cc @AndriySvyryd

@ajcvickers ajcvickers added this to the 5.0.2 milestone Dec 4, 2020
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Dec 7, 2020
@AndriySvyryd AndriySvyryd removed their assignment Dec 7, 2020
AndriySvyryd added a commit that referenced this issue Dec 8, 2020
AndriySvyryd added a commit that referenced this issue Dec 10, 2020
AndriySvyryd added a commit to dotnet-maestro-bot/EntityFrameworkCore that referenced this issue Dec 10, 2020
@ajcvickers ajcvickers changed the title How do I change the default property names on a many to many relationship Error using case-mismatched mapped properties in many to many relationship Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported Servicing-approved type-bug
Projects
None yet
Development

No branches or pull requests

3 participants