//Create Instance Accoding type private object CreateInstance(RegistrationModel model, object[] arg = null, object[] attributes = null) { object obj = null; var type = model.ObjectType; if (model.RegType == RegType.Singleton) { obj = SingletonCreationService.GetInstance().GetSingleton(type, arg); } if (model.RegType == RegType.Instance) { obj = InstanceCreationService.GetNewObject(type, arg, attributes); } return(obj); }
private object CreateInstance(RegistrationModel model, object[] arguments = null) { object returnedObj = null; Type typeToCreate = model.ObjectType; if (model.RegType == REG_TYPE.INSTANCE) { returnedObj = InstanceCreationService.GetInstance().GetNewObject(typeToCreate, arguments); } else if (model.RegType == REG_TYPE.SINGLETON) { returnedObj = SingletonCreationService.GetInstance().GetSingleton(typeToCreate, arguments); } return(returnedObj); }
public ActionProvider(InstanceCreationService objectCreation) { this.objectCreation = objectCreation; registrations = new Dictionary <Type, Type>(); }