How do I remove a type previously registered with IoC?
See original GitHub issueHi,
- ABP 3.4.0
- ASP.NET MVC 5
if (!IocManager.Instance.IsRegistered<IOzCpCacheManagerStatusResolver>())
{
if (ApplicationSettings.CacheManager.Enabled.Value && CacheManagerRuntime.Instance.Enabled)
{
IocManager.Instance.Register<IOzCpCacheManagerStatusResolver, OzCpCacheManagerStatusEnabledResolver>(DependencyLifeStyle.Singleton);
}
else
{
IocManager.Instance.Register<IOzCpCacheManagerStatusResolver, OzCpCacheManagerStatusDisabledResolver>(DependencyLifeStyle.Singleton);
}
}
How do I reverse IocManager.Instance.Register<>() so that IocManager.Instance.IsRegistered() will return FALSE once more?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Can I un-register types in Unity IoC?
Removing already registered types from UnityContainer at runtime? 1. Registering Types at Runtime · 6. Using Unity, How do I autoregister a ...
Read more >How to unregister or replace a registered type
Is it possible to unregister their implementations and swap with ours for specific interfaces? (They of course use Autofac as the IoC container)....
Read more >Remove unwanted instances from ServiceCollection in ...
This article will go a little further, I will show you how to unregister any type of service. Unregister any type of service....
Read more >Should the usage of DI/IoC remove all occurrences ...
Should the usage of Dependency Injection and an Inversion of Control container remove all occurrences of the " new " keyword from your...
Read more >Registering a type as an interface and as self with ASP.NET ...
Registering a type or a type factory “as self”. Back to our extension method! We want to start by removing the previous service...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reference: https://github.com/castleproject/Windsor/blob/master/docs/registering-components-one-by-one.md#register-more-components-for-the-same-service
@alexandis Please create a new issue.