Created
May 13, 2011 18:43
-
-
Save jonathascosta/971065 to your computer and use it in GitHub Desktop.
Instalador Windsor para objetos DAL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestDaoInstaller : IWindsorInstaller | |
{ | |
public void Install(IWindsorContainer container, IConfigurationStore store) | |
{ | |
container.Register( | |
AllTypes.FromAssemblyNamed("YourProduct.DataAccess") | |
.BasedOn(typeof(IDao<,>)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Select((t, baseType) => t.GetInterfaces()) | |
.BasedOn(typeof(IDao<>)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Select((t, baseType) => t.GetInterfaces()) | |
.BasedOn(typeof(IDao)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Select((t, baseType) => t.GetInterfaces())); | |
container.Register( | |
AllTypes.FromAssemblyNamed("Framework.DataAccess") | |
.BasedOn(typeof(IDao<,>)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Base() | |
.BasedOn(typeof(IDao<>)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Base() | |
.BasedOn(typeof(IDao)) | |
.Configure(c => c.LifeStyle.Transient) | |
.WithService.Base()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment