Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide easier opt-out for Func<> binding #22

Open
BrunoJuchli opened this issue Jul 21, 2014 · 1 comment
Open

Provide easier opt-out for Func<> binding #22

BrunoJuchli opened this issue Jul 21, 2014 · 1 comment

Comments

@BrunoJuchli
Copy link

Hi Remo
How about splitting the FuncModule into a FactoryModule (everything except .Bind(typeof(Func<...)) and a FuncFactoryModule?
This would allow for easier opt-out from Func<..>. The open Func<....> binding may hide issues with bindings when one wants to bind specific Func<MyFoo, MyBar>().

See http://stackoverflow.com/questions/24862138/stop-ninject-from-binding-funct-t-bool-automatically/24863850.

One could further provide an extension like

IBindingRoot.Bind<Func<MyFoo, MyBar>().ToFuncFactory();

or just

IBindingRoot.Bind<Func<MyFoo, MyBar>().ToFactory();

to simplify binding specific factories.

Please tell me whether you like the idea - in which case i'll happily provide pull request - or not.

EDIT: this is a duplicate of #21

@BrunoJuchli BrunoJuchli changed the title Provides Easier Opt-Out for Func<> binding Provide easier opt-out for Func<> binding Jul 21, 2014
@scott-xu
Copy link
Member

That's what I thought. Let's move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants