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

Add binding to all interfaces that a given type implements #47

Open
intentor opened this issue Jul 8, 2016 · 2 comments
Open

Add binding to all interfaces that a given type implements #47

intentor opened this issue Jul 8, 2016 · 2 comments
Assignees
Milestone

Comments

@intentor
Copy link
Owner

intentor commented Jul 8, 2016

The idea is to create a binding action that binds to all interfaces of a given type, like:

  • a class of name MyClass implements IInterface1, IInterface2, IInterface3.
  • to bind all of these interfaces to e.g. a singleton of MyClass, something like container.BindToInterfaces<MyClass>().ToSingleton<MyClass>() could be done.

The BindToInterfaces<T>() could receive classes or interfaces.

It could be also created a method that bounds to all inherited and implemented types of a given type.

@intentor intentor added this to the v2.18 milestone Jul 8, 2016
@intentor intentor self-assigned this Jul 8, 2016
@intentor
Copy link
Owner Author

intentor commented Jul 8, 2016

The name of the methods could be BindInterfacesFrom<T>() and BindClassFrom<T>().

@intentor intentor modified the milestones: v2.19, v2.18, v2.20, v2.21 Jul 13, 2016
@intentor intentor modified the milestones: v2.21, v2.20, v2.22 Jul 25, 2016
@intentor intentor modified the milestones: v2.22, v2.21 Dec 1, 2016
@intentor
Copy link
Owner Author

intentor commented Dec 9, 2016

This issue could be improved by adding a To() and ToSingleton methods using anonymous functions with a type definition object, so it's possible to create custom To definitions.

@intentor intentor modified the milestones: v2.23, v2.22 Dec 13, 2016
@intentor intentor removed this from the v2.23 milestone Jan 25, 2017
@intentor intentor added this to the v2.25 milestone Mar 1, 2017
@intentor intentor modified the milestones: v2.25, v2.26 Mar 10, 2017
@intentor intentor modified the milestones: v2.27, v2.26 Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant