In Pure IT |
Lately I was experimenting a little bit with Umbraco 7 and Hybrid Framework by Jeroen Breuer. It’s a great Umbraco extension, definitely worth checking. One thing I missed was some Dependency Injection (DI) container to inject custom data repositories into WebApi Controllers. After some reaserch I decided to give a chance to StructureMap.
Although code in this example is written based on StructureMap syntax, the general way of inserting IoC/DI containers into Umbraco project should be very similar for other containers like Autofac, Ninject or Unity.
In next steps I will show how to make StructureMap works with Umbraco 7 from very empty project. The solution structure will be similar to Hybrid Framework so you could also use it as starting point. Continue reading…