Skip to content

Commit d54f8a3

Browse files
committed
Always include fluent FK mapping even if only using data annotations
1 parent 98537ff commit d54f8a3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

EntityFramework.Reverse.POCO.Generator/EF.Reverse.POCO.Core.ttinclude

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,11 +2957,9 @@ SELECT SERVERPROPERTY('Edition') AS Edition,
29572957
mapKey = string.Format("\"{0}\"", fkCol.col.Name);
29582958
}
29592959

2960-
if (!Settings.UseDataAnnotationsSchema)
2961-
{
2962-
fkCol.col.ConfigFk.Add(string.Format("{0};{1}", GetRelationship(relationship, fkCol.col, pkCol, pkPropName, fkPropName, manyToManyMapping, mapKey, foreignKey.CascadeOnDelete, foreignKey.IncludeReverseNavigation, foreignKey.IsNotEnforced),
2963-
Settings.IncludeComments != CommentsStyle.None ? " // " + foreignKey.ConstraintName : string.Empty));
2964-
}
2960+
// Always include fluent FK mapping even if only using data annotations
2961+
fkCol.col.ConfigFk.Add(string.Format("{0};{1}", GetRelationship(relationship, fkCol.col, pkCol, pkPropName, fkPropName, manyToManyMapping, mapKey, foreignKey.CascadeOnDelete, foreignKey.IncludeReverseNavigation, foreignKey.IsNotEnforced),
2962+
Settings.IncludeComments != CommentsStyle.None ? " // " + foreignKey.ConstraintName : string.Empty));
29652963

29662964
if(foreignKey.IncludeReverseNavigation)
29672965
pkTable.AddReverseNavigation(relationship, pkTableHumanCase, fkTable, fkPropName, string.Format("{0}.{1}", fkTable.Name, foreignKey.ConstraintName), foreignKeys);

0 commit comments

Comments
 (0)