You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document how to compensate for conventions different in EF Core than EF6 #1971
For example, shadow FK property names in EF Core are PrincipalId rather than the Principal_Id name used by independent associations in EF6. This can be fixed with something like:
protectedoverridevoidOnModelCreating(ModelBuildermodelBuilder){// Other model building here...foreach(varforeignKeyinmodelBuilder.Model.GetEntityTypes().SelectMany(e =>e.GetDeclaredForeignKeys())){// Note that something different would be needed for composite keysif(foreignKey.Properties.Count==1){foreignKey.Properties[0].SetColumnName(foreignKey.PrincipalEntityType.Name+"_Id");}}}
Activity
AndriySvyryd commentedon Dec 14, 2019
Related: #1989