Parsing expression trees is pretty complicated, as there's no end to what you can add there: you can specify a complicated expression there spanning a lot of entities. Parsing expression trees in our linq provider is a complicated process which isn't re-usable here, hence we don't offer that.
It's not all bad tho. The QuerySpec extension methods make specifying the predicates not that complicated.
adapter.DeleteEntitiesDirectly(new RelationPredicateBucket(CustomerFields.Name.Equal("John")));
If you hate the bucket ctor call, you can add an extension method, e.g. ToBucket(IPredicate) :
public static IRelationPredicateBucket(this IPredicate toWrap)
{
return new RelationPredicateBucket(toWrap);
}
Which then leads to:
adapter.DeleteEntitiesDirectly(CustomerFields.Name.Equal("John").ToBucket());