File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
EntityFramework.Reverse.POCO.Generator Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 62746274 if (isEfCore3Plus && t.IsView && !t.HasPrimaryKey)
62756275 return "builder.HasNoKey();";
62766276
6277+ if (t.PrimaryKeys.All(k => k.Hidden))
6278+ return string.Empty;
6279+
62776280 var defaultKey = $"builder.HasKey({t.PrimaryKeyNameHumanCase()})";
62786281 if (t.Indexes == null || !t.Indexes.Any())
62796282 return defaultKey + ";";
Original file line number Diff line number Diff line change @@ -172,6 +172,9 @@ public override string PrimaryKeyModelBuilder(Table t)
172172 if ( isEfCore3Plus && t . IsView && ! t . HasPrimaryKey )
173173 return "builder.HasNoKey();" ;
174174
175+ if ( t . PrimaryKeys . All ( k => k . Hidden ) )
176+ return string . Empty ;
177+
175178 var defaultKey = $ "builder.HasKey({ t . PrimaryKeyNameHumanCase ( ) } )";
176179 if ( t . Indexes == null || ! t . Indexes . Any ( ) )
177180 return defaultKey + ";" ;
You can’t perform that action at this time.
0 commit comments