public void Register(Type TClass, RegistrationScopeEnum registrationType) { var binder = Kernel.Bind(TClass).ToSelf(); if (registrationType == RegistrationScopeEnum.Singleton) { binder.InSingletonScope(); } }
public void Register(Type TClass, Type @interface, RegistrationScopeEnum registrationType) { var binder = Kernel.Bind(@interface).To(TClass); if (registrationType == RegistrationScopeEnum.Singleton) { binder.InSingletonScope(); } }
private LifetimeManager GetLifetimeManager(RegistrationScopeEnum registrationType) { switch (registrationType) { case RegistrationScopeEnum.Default: return(null); case RegistrationScopeEnum.Singleton: return(new ContainerControlledLifetimeManager()); } return(null); }
private void RegisterAsType(IRegistrationBuilder <object, ConcreteReflectionActivatorData, SingleRegistrationStyle> registrationBuilder, RegistrationScopeEnum registrationType) { switch (registrationType) { case RegistrationScopeEnum.Default: registrationBuilder.InstancePerDependency(); break; case RegistrationScopeEnum.Singleton: registrationBuilder.SingleInstance(); break; } }
public void Register(Type TClass, RegistrationScopeEnum registrationType) { Container.RegisterType(TClass, GetLifetimeManager(registrationType)); }
public void Register(Type TClass, RegistrationScopeEnum registrationType) { RegisterAsType(_containerBuilder.RegisterType(TClass).AsSelf(), registrationType); }
public void Register(Type TClass, Type @interface, RegistrationScopeEnum registrationType = RegistrationScopeEnum.Default) { RegisterAsType(_containerBuilder.RegisterType(TClass).As(@interface), registrationType); }
public RegisterThisServiceAttribute() { _registrationType = RegistrationScopeEnum.Default; }
public RegisterThisServiceAttribute(RegistrationScopeEnum registrationType) { _registrationType = registrationType; }