1
Vote

UnitOfWork appears to have a bug in the use of _depth

description

I get that the UnitOfWork is storing instances in the context with _depth as part of the key. Unfortunately, the _depth is a static property and so multiple requests hitting a site at the same time (but completing at different times) can get different instances of UnitOfWork (or none at all) using the static _depth. I think perhaps a stack of the UnitOfDepth instances in the local context would be a better way to ensure that when one goes into/out of scope, the references to that instance are the same when retrieved from a UnitOfWork static method.
 
Thanks!
 
James

comments