tomahawk wrote:
Hi there,
I need to delete a few entities directly from the dB (not loading first) and am having trouble understanding how to do this. I have a UnitOfWork object involved, and I saw the AddDeleteMultiCall, and thought to use it. I am using the following code:
uow.AddDeleteMultiCall(new ContributionsCollection(),PredicateFactory.CompareValue( ContributionsFieldIndex.CommitteeID,ComparisonOperator.Equal,(int)this.data.Tag2));
This gives me an exception about a missing relationWalk object.
What is the proper way to accomplish a direct delete of some entities using a UnitOfWork object?
Thanks,
Josh
Josh,
I'm not seeing anything wrong with your statement. However, try this and see if it makes any difference:
ContributionsCollection Contributions = new ContributionsCollection();
IPredicateExpression filter = new PredicateExpression();
filter.Add(PredicateFactory.CompareValue(ContributionsFieldIndex.CommitteeID,ComparisonOperator.Equal,(int)this.data.Tag2));
uow.AddDeleteMultiCall(Contributions, filter);