LLBLGen - DeleteMulti
- by Neil
I have a checkboxlist of categories, during an update, I am trying to delete all the items in list from the associate table, then insert them all (so I don't have to determine if an item already exists in the associate table and only insert newly checked items). Here is the code I have:
// First we need to delete the records from ArticleTopicCategory where articleId is the id of the article we are updating
List<Guid> categoriesToDelete = new List<Guid>();
foreach (Guid category in this.View.SelectedCategories)
{
categoriesToDelete.Add(category);
}
ArticleTopicCategoryCollection articleCategories = new ArticleTopicCategoryCollection();
PredicateExpression filter = new PredicateExpression(ArticleTopicCategoryFields.Id == categoriesToDelete);
articleCategories.DeleteMulti(filter);
'categoriesToDelete' holds a valid list of Guid's that need to be deleted, but they are not being deleted.
Thanks in advance!