using StructureMap.Graph;
using StructureMap.Graph.Scanning;
public static void Main()
var registry = new SomeRegistry();
new Container(new SomeRegistry());
public class SomeRegistry : Registry
i.Assembly("Some.Assembly");
i.AddAllTypesOf<ISomeType>().NameBy(x => x.Name.Replace("SomeType", ""));
i.Convention<SomeConvention>();
i.WithDefaultConventions();
i.SingleImplementationsOfInterface();
public class SomeOtherRegistry : Registry
public SomeOtherRegistry()
public class SomeConvention : IRegistrationConvention
public void ScanTypes(TypeSet types, Registry registry)
types.AllTypes().ToList().ForEach(type =>
type.GetInterfaces().ToList().ForEach(i =>
registry.For(i).Use(type);
public interface ISomeType