public StorageBuilder Register <T>(params object[] constructorParameters) { IConstructorParameters parameters = ConstructorParametersGenerator.GenerateParameters(constructorParameters); return(Update(x => { Type type = typeof(T); AssemblyRegistrar.RegisterIfNotExist(x.Assemblies, type.Assembly); IEnumerable <IService> services = ServicesGenerator.GenerateServices(typeof(T), Object.Assemblies, null, parameters); ServiceRegistrar.Register(Object.Services, services); })); }
public void Register <T>(params object[] parameters) { Type type = TypeGetter.GetType <T>(); IConstructorParameters constructorParameters = ConstructorParametersByObjectsGenerator.GenerateParameters(parameters); IEnumerable <IService> services = ServicesGenerator.GenerateServices(type, Storage.Assemblies, this, constructorParameters); foreach (IService service in services) { if (ServiceIsAutoValueChecker.Check(service)) { ServiceInitializer.Initialize(service, this); } } ServiceRegistrar.Register(Storage.Services, services); }