© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
2y ago
•
8 replies
G1lles
Entity Framework Foreign Key
What is better
? Declaring your foreign keys in your model and declaring it in your modelbuilder
(
.hasForeignKey
) or doing it by only declaring the relationship in your modelbuilder
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
Foreign Key | Entity Framework
C
C# / help
2y ago
Entity Framework Foreign Key restraint
C
C# / help
16mo ago
Entity Framework Core 8 -Foreign Key Constraint failure.
C
C# / help
2y ago
❔ Entity Framework not required foreign key as required?
C
C# / help
3y ago