Ejemplo n.º 1
0
        private Lifestyle GetCachedLifestyle(Lifestyle lifestyle)
        {
            if (!lifestyleCache.Contains(lifestyle, new LifestyleComparer()))
            {
                lifestyleCache.Add(lifestyle);
            }

            return lifestyleCache.SingleOrDefault(cache => cache.GetType() == lifestyle.GetType());
        }
Ejemplo n.º 2
0
 public Registration(Type serviceType, Func<object> implementationProducer, Lifestyle lifestyle = null)
 {
     ServiceType = serviceType;
     ImplementationProducer = implementationProducer;
     Lifestyle = lifestyle ?? Lifestyle.Transient;
 }
Ejemplo n.º 3
0
 public Registration(Type serviceType, Type implementationType, Lifestyle lifestyle = null)
 {
     ServiceType = serviceType;
     ImplementationType = implementationType;
     Lifestyle = lifestyle ?? Lifestyle.Transient;
 }