public void Register <TInterface, TClass>(LifeCycleTypes lifeCycleType = LifeCycleTypes.TRANSIENT) where TClass : TInterface { RegistryEntry entry; Registry.TryGetValue(typeof(TInterface), out entry); if (entry != null) { throw new Exception("Interface: " + typeof(TInterface) + " is already registered."); } else { entry = new RegistryEntry(typeof(TClass), lifeCycleType); Registry[typeof(TInterface)] = entry; } }
public RegistryEntry(Type classType, LifeCycleTypes lifeCycleType) { Class = classType; LifeCycleType = lifeCycleType; }
public RegistryEntry(Type classType, LifeCycleTypes lifeCycleType) { Class = classType; LifeCycleType = lifeCycleType; }