private void RegisterObject(ObjectToRegister objectToRegister, ContainerBuilder containerBuilder) { containerBuilder.RegisterInstance(objectToRegister.obj) .As(objectToRegister.GetType()) .SingleInstance() .As(objectToRegister.additionalTypes); }
public void AddObjectToRegister( object obj, Type[] additionalTypes, bool objectFromFramework = false) { var toRegister = new ObjectToRegister { obj = obj, additionalTypes = additionalTypes }; if (objectFromFramework) { frameworkObjectsToRegister.Add(toRegister); } else { objectsToRegister.Add(toRegister); } }