tags:

views:

26

answers:

2

Example

MyConstruction(IEnumberable<IMyInterface> myInterfaces)
{
}

where I have a couple of classes that implement IMyInterface.

+1  A: 

I actually found a blog post describing this issue. It isn't exactly what I was looking for because I would rather not have to explicitly list the implementations.

http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/09/03/building-arrays-in-structuremap-2-5.aspx

Robin Robinson
+3  A: 

You don't have to declare them explicitly. Take advantage of the scanning feature:

Scan(x =>
{
    x.TheCallingAssembly(); // or specify additional assemblies to scan

    x.AddAllTypesOf<IMyInterface>();
});
Joshua Flanagan
Thanks. I use scan now, I was just missing the AddAllTypes call. Haven't seen that one before.
Robin Robinson