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

Change Registration at run time? #88

Closed
JohnMcAvinue opened this issue Jan 15, 2016 · 1 comment
Closed

Change Registration at run time? #88

JohnMcAvinue opened this issue Jan 15, 2016 · 1 comment

Comments

@JohnMcAvinue
Copy link

Hi,

I have two concrete implementations for an interface. One is these is always used except for when a Demo mode is enabled. How can I change the implementation at run time when this happens? I don't see a Remove or Replace function on the container.

Thanks

@grumpydev
Copy link
Owner

Registrations overwrite the previous one for the same type. Depending on the lifetime of your objects, and whether the "demo" mode can be toggled at runtime, you may be better with some sort of proxy object though.

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