Update one-to-many EntityKey using Foreign Key
- by User.Anonymous
To use by the easiest way Entity Framework, I use partial class to add Foreign Key on most important Entities Model.
For example, I have an Entity "CONTACT" which have "TITLE", "FUNCTION" and others.
When I update a CONTACT, with this code, Foreign Key are automatically updated :
public int? TitId
{
get
{
if…