Skip to content

Conversation

@BrunoJuchli
Copy link

We would like to have IBindSyntax.Bind<> syntax to bind a specific interface, like:

IBindingRoot.Bind(x => x
         .FromCurrentAssembly()
         .SelectAllClasses()
         .InheritingFrom<IFoo>
         .Bind<IFoo>);

Hint:

  • The pull request also contains IBindSyntax.Bind(params Type[] serviceTypes). We don't need that but i felt i wouldn't make it more complex. If you think it only blows up the syntax interface without generating adequate benefit feel free to remove it (or tell me to remove it ;-) ).
    • This required adapting the kernel mock in order to be able to test .Bind(typeof(IFoo), typeof(IBar)).To(typeof(FooBar)) style bindings.
  • Also i did not base it on IBindSyntax.BindSelection(...) since i felt it makes it more complicated then necessary. But if you insist on it i will adapt the pull requeset ;-).

IBindSyntax.Bind<T>();
IBindSyntax.Bind(params Type[] types);
@danbopes
Copy link

Damn, since 2014 :(

This would have been a rather nice thing to have implemented.

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

Successfully merging this pull request may close these issues.

2 participants