This will give you an unique UoW every time you try to resolve IUnitOfWork. This is probably not correct if you are using this in a web app (UoW per request == HttpContext or Hybrid)
case InstanceScope.PerRequest:
return null;
case InstanceScope.Singleton:
return new SingletonLifecycle();
case InstanceScope.HttpContext:
return new HttpContextLifecycle();
case InstanceScope.ThreadLocal:
return new ThreadLocalStorageLifecycle();
case InstanceScope.Hybrid:
return new HybridLifecycle();
case InstanceScope.HttpSession:
return new HttpSessionLifecycle();
case InstanceScope.HybridHttpSession:
return new HybridSessionLifecycle();
case InstanceScope.Unique:
return new UniquePerRequestLifecycle();
Hope this helps!
/Andreas
http://andreasohlund.blogspot.com
http://twitter.com/andreasohlund
From:
mik...@zoolutions.seDate: Wed, 13 Jan 2010 12:44:12 +0100
Subject: [sm-users] Sanity check on unique per request
To:
structure...@googlegroups.com