Hello
I have two tables with a one to many relationship Cart and CartItems
I would like to delete a group of Items but I need to first get the UserId from the cart then delete only the items from that useres cart that are in a sertain shipping window which is called PreSeasonScheduleId.
I have tried Detete Mulit and DeleteMultiManytoOne but I am affraid I just don't understand how to make this work?
I am usind self servicing and using getMulti with the code below returns the correct data.
CartItemCollection shipWindowItems = new CartItemCollection();
RelationCollection cartRelation = new RelationCollection();
cartRelation.Add(CartEntity.Relations.CartItemEntityUsingCartId);
IPredicateExpression cartFilter = new PredicateExpression();
cartFilter.Add(CartFields.UserId == UserID);
cartFilter.AddWithAnd(CartItemFields.PreSeasonScheduleId == _PreSeasonScheduleId);
shipWindowItems.DeleteMultiManyToOne();
Thanks for you help,
Todd