Skip to content

Instantly share code, notes, and snippets.

@ianfnelson
Created September 18, 2014 13:02
Show Gist options
  • Save ianfnelson/cfbe381862b8c7b1e084 to your computer and use it in GitHub Desktop.
Save ianfnelson/cfbe381862b8c7b1e084 to your computer and use it in GitHub Desktop.
Snippets for 2009 blog post "Castle Windsor Array Resolution Gotcha"
/// <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;
}
container.Register(
AllTypes
.Of<ILeadAllocator>()
.FromAssemblyNamed("Marshalls.Leads.ApplicationService")
.WithService
.FromInterface(typeof(ILeadAllocator))
.Configure(c => c.LifeStyle.Transient));
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