Hi,
I'm looking at what the best practice is for deleting an item from an entity collection (Eg. Order and Order Lines).
When an Order Line is removed/deleted by the user there is additional logic that must fire regarding additional fields etc that need to be modified on the main Order screen. The deletion of an order line may also lead to the automatic deletion of other order lines. All the deletion is to be performed in a Business Layer library.
What's everyone's thoughts?
Is the best way to tackle this to have the BL pass back some kind of collection of items to be removed, have the GUI process them in terms of UI adjustments and then tell the BL to actually delete them? This seems like a few extra steps. I'd prefer to have the BL actually delete the entities and pass back what entities were deleted but in LLBL it's impossible to access the properties of a deleted entity (due to the inbuilt exception). Sure - the objects been deleted from persistent storage but shouldn't you still be able to access it and see what was deleted or some IsDeleted property?