private Lifestyle GetCachedLifestyle(Lifestyle lifestyle) { if (!lifestyleCache.Contains(lifestyle, new LifestyleComparer())) { lifestyleCache.Add(lifestyle); } return lifestyleCache.SingleOrDefault(cache => cache.GetType() == lifestyle.GetType()); }
public Registration(Type serviceType, Func<object> implementationProducer, Lifestyle lifestyle = null) { ServiceType = serviceType; ImplementationProducer = implementationProducer; Lifestyle = lifestyle ?? Lifestyle.Transient; }
public Registration(Type serviceType, Type implementationType, Lifestyle lifestyle = null) { ServiceType = serviceType; ImplementationType = implementationType; Lifestyle = lifestyle ?? Lifestyle.Transient; }