c# - EF Core - adding/updating entity and adding/updating ...
stackoverflow.com › questions › 48359363Jan 21, 2018 · EF Core - adding/updating entity and adding/updating/removing child entities in one request. I am struggling with what seemed to be a couple of basic operations. public class Master { public Master () { Children = new List<Child> (); } public int Id { get; set; } public string SomeProperty { get; set; } [ForeignKey ("SuperMasterId")] public SuperMaster SuperMaster { get; set; } public int SuperMasterId { get; set; } public ICollection<Child> Children { get; set; } } public class ...
Basic Save - EF Core | Microsoft Learn
learn.microsoft.com › en-us › efMar 11, 2021 · EF will automatically detect changes made to an existing entity that is tracked by the context. This includes entities that you load/query from the database, and entities that were previously added and saved to the database. Simply modify the values assigned to properties and then call SaveChanges. C#.