What's the best way to insert an entity only if there's a related row in the database with a particular column value. Something like this imaginary query...
INSERT INTO Foo (Id, col1) VALUES (4, 1)
INNER JOIN Bar ON Foo.Id = Bar.Id
WHERE Bar.Status = 1