Hi Guys,
I have a wizard thats collects user actions to a unit of work object and commits them. All in all, seems to be working quite well util I reach the following code:
// delete current relationships
IRelationPredicateBucket bucket = new RelationPredicateBucket(ProductVsCategoryFields.ProductId == entity.ProductId);
work.AddDeleteEntitiesDirectlyCall("ProductVsCategoryEntity", bucket);
// create new relationships
foreach (int categoryid in categories)
{
ProductVsCategoryEntity category = new ProductVsCategoryEntity();
category.ProductId = entity.ProductId;
category.CategoryId = categoryid;
category.IsNew = true;
work.AddForSave(category);
}
Independantly, the delete parts and the save parts work correctly but when used together the Saves are performed first and the Deletes afterwards. Is there anyway around this?
Cheers,
Th