I have an entity, let\'s call it CommonEntity that has a primary key used as a foreign key in many other entities. As the application is developed these links w
CommonEntity
You can try this:
var allrelatedEnds = ((IEntityWithRelationships)ce).RelationshipManager.GetAllRelatedEnds(); bool hasRelation = false; foreach (var relatedEnd in allrelatedEnds) { if (relatedEnd.GetEnumerator().MoveNext()) { hasRelation = true; break; } } if (!hasRelation) { //Delete }