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

contains/registration conditional #86

Open
ivlevAstef opened this issue Mar 27, 2017 · 3 comments
Open

contains/registration conditional #86

ivlevAstef opened this issue Mar 27, 2017 · 3 comments

Comments

@ivlevAstef
Copy link
Owner

Added contains function in DITranquillity:

container.contains(type: Protocol.self) // contains(type: "Protocol")
container.contains(component: Component.self) // contains(component: "Component")
container.contains(module: Module.self) // contains(module: "Module")

@ivlevAstef
Copy link
Owner Author

Only for 3.0.0 version - because this version it's new coil and add extensions.

@ivlevAstef ivlevAstef added this to the v3.0.0 milestone Mar 30, 2017
@ivlevAstef
Copy link
Owner Author

container.contains(Protocol.self)
container.contains(framework: Framework.self)

@ivlevAstef
Copy link
Owner Author

ivlevAstef commented Dec 14, 2024

I check Autofac and find good idea. registration with conditional. https://autofac.readthedocs.io/en/latest/register/registration.html#conditional-registration

And your can write:
register(...)
.when(register: Type.self)
.when(noRegister: Type.self)
.when(condition: { ... })

Need it is better to work out the idea, but it's very good idea, and it can be useful.

@ivlevAstef ivlevAstef changed the title contains contains/registration condition Dec 14, 2024
@ivlevAstef ivlevAstef changed the title contains/registration condition contains/registration conditional Dec 14, 2024
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