When I register the following in SM and then attempt to create an instance I get the exception - 'StructureMap Exception Code: 202 No Default Instance defined for PluginFamily...'
Scan(x =>
{
x.Assembly("MVCDemo");
x.Assembly("MVCDemo.Infrastructure");
x.Assembly("MVCDemo.Services");
x.AddAllTypesOf(typeof (IRepository<>));
});
ForRequestedType<IRepository<Employee>>().TheDefault.Is.ConstructedBy(() => new EmployeeRepository());
var tmp4 = ObjectFactory.GetInstance<IRepository<Employee>>();
The exception occurs when I try and get an instance of IRepository.
Does anyone know what I'm missing?
Cheers
Ollie