Support for Multiple Conventions?

Aug 19, 2011 at 1:49 AM

Is there support for registering multiple conventions, so that for each property the first one in the list that matches will execute the assignment, and if not, it will fall back to the next?

Aug 19, 2011 at 7:13 AM

well thats how it works if you do a.InjectFrom<C1>(b).InjectFrom<C2>(b).InjectFrom ... etc.

Aug 19, 2011 at 1:49 PM

Understood, but right now my code would say something like the following:

a
.Injectfrom<SelectListConvention>(dealer)
.InjectFrom<SelectListValueConvention>(dealer)
.InjectFrom<NullableConvention>(dealer)
.Inject(dealer)

 

I would rather register all the conventions and call it once.

//Global
Injector.RegisterConvention<SelectListConvention>();
Injector.RegisterConvention<SelectListValueConvention>();
Injector.RegisterConvention<NullableConvention>();
Injector.RegisterConvention<DefaultConvention>();

//Class Method
a.Inject(dealer);

Thoughts?

Aug 19, 2011 at 3:14 PM

create a class with a static(or not static) method that does that