First (optional):
I recommend you do
public ICollection<PhoneNumber> phones {get; private set;}
a virtual to let Entity Framework know that it should be lazy loaded (even if you don't have Lazy Load enabled, this is good practice).
public virtual ICollection<PhoneNumber> phones {get; private set;}
Second
Add the Reverse Navigation Property to your PhoneNumber class (it will be required to get the solution that I give below):
public class PhoneNumber : IValueObject { public string Number {get; set;} public string Type {get; set;} public virtual Customer {get; set;} } public class Customer : IEntity { public ICollection<PhoneNumber> phones {get; private set;}
Third (possible solution for your problem):
Remove PhoneNumber objects from context instead from Customer :
public ICollection<PhoneNumber> phones {get; private set;}
source share