-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Log a warning when Ignore is called on an explicitly configured property or type #12082
Comments
@Tarig0 Why are you both referencing and ignoring the property explicitly? |
Because I wasn't ignoring the property when I was using the value converter feature, then switched to a private store property, and didn't update the key. |
Unfortunately if |
I think the issue I'm seeing is that the Model is invalid so the program shouldn't be able to continue with the configuration. Not that I want the model to remove the alternate key, but to say hey this alternate key is not valid bad program. modelBuilder.Entity<Counter>().HasAlternateKey(c => new { c.StyleKey, c.IsTest, c.Discriminator }); //This should be c.StrDiscriminator
modelBuilder.Entity<Counter>().Ignore(c => c.Discriminator); |
@Tarig0 I understand that in your case the model configuration is contradicting and doesn't produce the expected model. But |
… explicitly mapped An old bug. Fixes #12082
… explicitly mapped An old bug. Fixes #12082
When ignoring a property that is explicitly used in a key throw an error
Steps to reproduce
Further technical details
EF Core version: 2.1.0 rc1 final
Database Provider: Microsoft.EntityFrameworkCore.Sqlite
Operating system: Win10
IDE: Visual Studio 2017 15.7.1
The text was updated successfully, but these errors were encountered: