How should I use the unit of work pattern in the following scenario:
I'm writing a winforms app. I have one screen where the user can edit a single order. On this screen, the user can open another form to select the delivery company. The user can also add/edit existing delivery companies in this child form before doing the selection.
How can I implement this scenario using the Unit of work pattern? Currently I have one unit of work for the order entry screen. My first thought was to include the child form in this unit of work too. The problem is, delivery company changes should be persisted when in the child form . But when I persist changes to the delivery companies, this will also persist the changes in the order.
Should I create a second unit of work for any edits to the delivery companies? In that case, how can I make the changes in that unit of work visible in the first unit of work?