Created
September 18, 2014 13:02
-
-
Save ianfnelson/cfbe381862b8c7b1e084 to your computer and use it in GitHub Desktop.
Snippets for 2009 blog post "Castle Windsor Array Resolution Gotcha"
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
/// <summary> | |
/// Initializes a new instance of the LeadAllocationService class. | |
/// </summary> | |
/// <param name="leadAllocators">Array of Lead Allocators.</param> | |
public LeadAllocationService(params ILeadAllocator[] leadAllocators) | |
{ | |
this.LeadAllocators = leadAllocators; | |
} |
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
container.Register( | |
AllTypes | |
.Of<ILeadAllocator>() | |
.FromAssemblyNamed("Marshalls.Leads.ApplicationService") | |
.WithService | |
.FromInterface(typeof(ILeadAllocator)) | |
.Configure(c => c.LifeStyle.Transient)); |
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
container.Kernel.Resolver.AddSubResolver( | |
new ArrayResolver(container.Kernel)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment