I\'ve got an interface:
IRepository where T : IEntity
while im knocking up my UI im using some fake repository implementations tha
There is an easier way to do this. Please see this blog posting for details: Advanced StructureMap: connecting implementations to open generic types
public class HandlerRegistry : Registry
{
public HandlerRegistry()
{
Scan(cfg =>
{
cfg.TheCallingAssembly();
cfg.IncludeNamespaceContainingType();
cfg.ConnectImplementationsToTypesClosing(typeof(IRepository<>));
});
}
}
Doing it this way avoids having to create your own ITypeScanner
or conventions.