The unit of work is a great example, and I have included it in our CUD repository operations ...
The only thing I see as a drawback is the inability to return to the calling code the ID (or possibly the response of the DTO (s)) of several objects associated with the Unit of work when it comes to Create ().
For example, let's say I have a Customer and Order object. I create new transition objects in my code, add them via the .Create () method for the unit of work, and then complete the block of work.
Although my objects are correctly stored in the database, I do not call every Repository.Create () object from my consumer code, Unit of Work, so I have no way to send any information back to the consumption code related to each specific object.
Any ideas? Could it be (or better to ask the question, SHOULD) that the work module be expanded to return some type, maybe a user object, which may have object types with their new identifier in the dictionary, or something like that?
I just don’t know if these are suitable tasks for the Work Group. In the examples in books and blogs, I have not yet seen this problem.
Any thoughts?
source share