How do I delete a child entity from a parent collection with Entity Framework 4?
- by simonjreid
I'm using Entity Framework 4 and have a one-to-many relationship between a parent and child entity. I'm trying to delete a child using the parent repository by removing it from the parent's children collection:
public virtual void RemoveChild(Child child)
{
children.Remove(child);
}
When I try to save the changes I…