Ejemplo n.º 1
0
        private void SetLifetime(IRegistration reg)
        {
            // must cast to IServiceRegistrar for behavior wrappers
            switch (LifetimeForRegisters)
            {
            case ServiceRegistrarLifetime.Transient: break;

            case ServiceRegistrarLifetime.Singleton: reg.AsContainerSingleton(); break;

            case ServiceRegistrarLifetime.Request: reg.AsRequestSingleton(); break;

            case ServiceRegistrarLifetime.Thread: reg.AsThreadSingleton(); break;

            case ServiceRegistrarLifetime.Session: reg.AsSessionSingleton(); break;

            case ServiceRegistrarLifetime.Pooled: reg.AsCached(); break;

            default: throw new NotSupportedException();
            }
        }
Ejemplo n.º 2
0
 public void Session()
 {
     _registration.AsSessionSingleton();
 }