Unit of work pattern
问题 I'm looking for some advices about the unit of work pattern. Is the commit on the unit of work called multiple times or just one time and then leaving the object for garbage collection? Is it a good idea to inject the unit of work play or should I pass it around in method call when asking objects to perform some work? 回答1: Instances of types that implement the unit of work pattern usually have a single owner that needs to control its lifetime. Methods like Commit , Open , Close , and Dispose