views:

218

answers:

1

Is it possible to configure the Unity Dependency Injection framework to resolve by convention. So in other words if I have an ICustomerRepository when it tries to resolve this it will first look to see if there are any registered types and if not will then by convention try and resolve CustomerRepository class.

This would save a lot of repetitive coding.

+4  A: 

Check this blog post: Convention-based Registration Extension for Unity

Sly
(+1) That´s pretty cool!
Johan Leino
Thanks. I took this and modified for my needs and works very well.
Craig
What changes did you need to make?
Derek Greer