What is the right way to delete collection element from STE. Currently I use the following code:
order.Items[i].MarkAsDeleted();
order.Items.RemoveAt(i);
Looks like it works (and ApplyChanges removes entity in spite I have removed it from collection). But it looks a bit ugly. Am I doint it right? Or may be there are other ways?
This text is taken directly from MSDN:
So you are not doing it wrong because once you mark item as deleted it should be already removed from the
Itemscollection so removing item at index will most probably remove break relation with another one.