Got to admit that a feature like this does make you question why I use IT:AD:Unity so often…
//Notice how it's an open type:
Type closingType = typeof(IUnitTestDbContextSeeder<>);
ObjectFactory
.Initialize(config => config.Scan(scanner =>
{
scanner.Assembly(GetType().Assembly);//this assembly only...
scanner.IncludeNamespaceContainingType<DefaultStudentSeeder>();//this ns only...
scanner
//register types implementing open contract as singletons:
.ConnectImplementationsToTypesClosing(closingType) //<-- NEAT!
.OnAddedPluginTypes(expression => expression.Singleton()); //as singletons
}
));