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
Just let it fail. If the entity has many relationships, that verification could be really heavy.
public bool TryDelete(int id)
{
try
{
// Delete
return true;
}
catch (SqlException ex)
{
if (ex.Number == 547) return false; // The {...} statement conflicted with the {...} constraint {...}
throw; // other error
}
}