The other day I wanted to control the scope of a service inside a web based app with semantics which didn't fit either 'HttpContextScoped' or 'Singleton' - the first was to fine-grained and the other to coarse. What I required was an instance of the service to have the semantics of 'Singleton' but only for a short time, this is where 'ILifecycle' comes in, it allows you define your own lifecycle for a type inside StrucutreMap.The soultion I came up with was to use the HttpContext cache to cache the instance of 'IObjectCache' and use the cache timeout...
Monday, 16 August 2010
Subscribe to:
Posts (Atom)