This Exception often means you have not added the class (in this case IRepository) to the list of Registered types for the Container.
The rememdy:
Either add the type explicitly:
ObjectFactory.Initialize(x => { x.For<ABSTRACT_TYPE>().Use<CONCRETE_TYPE>(); } );
OR get StructureMap to scan the whole assembly:
ObjectFactory.Initialize(x => { x.Scan( scan => { scan.AssemblyContainingType<CONCRETE_TYPE>(); } ); } );
No comments:
Post a Comment