private static ComponentRegistration <T> AplicarEstiloDeVida <T>(ComponentRegistration <T> registracao, EstiloDeVidaDependencia estiloDeVida) where T : class { switch (estiloDeVida) { case EstiloDeVidaDependencia.Singleton: return(registracao.LifestyleSingleton()); case EstiloDeVidaDependencia.Transient: return(registracao.LifestyleTransient()); default: return(registracao); } }
public void Registrar(Type tipo, Type impl, EstiloDeVidaDependencia estiloDeVida = EstiloDeVidaDependencia.Singleton) { ContainerIoC.Register(AplicarEstiloDeVida(Component.For(tipo, impl).ImplementedBy(impl), estiloDeVida)); }
public void Registrar <TTipo, TImpl>(EstiloDeVidaDependencia estiloDeVida = EstiloDeVidaDependencia.Singleton) where TTipo : class where TImpl : class, TTipo { ContainerIoC.Register(AplicarEstiloDeVida(Component.For <TTipo, TImpl>(), estiloDeVida)); }
public void Registrar(Type tipo, EstiloDeVidaDependencia estiloDeVida = EstiloDeVidaDependencia.Singleton) { ContainerIoC.Register(AplicarEstiloDeVida(Component.For(tipo), estiloDeVida)); }
public void Registrar <T>(EstiloDeVidaDependencia estiloDeVida = EstiloDeVidaDependencia.Singleton) where T : class { ContainerIoC.Register(AplicarEstiloDeVida(Component.For <T>(), estiloDeVida)); }