Conventions Extension GenericBindingGenerator Equivalent in 3.0

221 views
Skip to first unread message

G.McNicol

unread,
Apr 30, 2012, 9:30:07 AM4/30/12
to nin...@googlegroups.com
Hi, what would be the 3.0 equivalent to this:

Kernel.Scan(x =>
{
    x.BindingGenerators.Add(new GenericBindingGenerator(typeof(ICommandHandler<>)));
});

I can find no examples of this.

Thanks

Gareth

Remo Gloor

unread,
Apr 30, 2012, 9:39:00 AM4/30/12
to nin...@googlegroups.com

Generics aren’t handled in a special way anymore. Just configure them as you would configure any other class.

--
You received this message because you are subscribed to the Google Groups "ninject" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ninject/-/hO5bt0WmEFMJ.
To post to this group, send email to nin...@googlegroups.com.
To unsubscribe from this group, send email to ninject+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ninject?hl=en.

G.McNicol

unread,
Apr 30, 2012, 9:49:37 AM4/30/12
to nin...@googlegroups.com
So, there's no conventional way to do it?

If not, I'll have to switch containers.

Bartelink, Ruben

unread,
Apr 30, 2012, 10:56:23 AM4/30/12
to nin...@googlegroups.com
What Remo is saying is that there is no longer any magic special casing of how generic bindings are handled in the conventions extension vs how types that are not open generics are handled.

In other words any binding syntax that you can use outside of the conventions extension will work against it.


There are examples of how one does bindings in general (though probably not anything specific re conventions with open generic bindings - the point being that its just how you'd do it without the conventions)

--R

G.McNicol

unread,
May 1, 2012, 5:09:36 AM5/1/12
to nin...@googlegroups.com
Gotcha!

Cheers!
Reply all
Reply to author
Forward
0 new messages