How to manage dependency registration in NopCommerce 3.90 depending upon plugin installed or not?

56 views Asked by At

I have created one plugin, in that I am overriding some methods from ProductService (and more). For that I have registered my CustomProductServie to IProductService.

While my Plugin is installed, it is working fine but after uninstalling the plugin. it is overriding ProductService methods. (NopCommerce 3.90)

1

There are 1 answers

1
Divyang Desai On BEST ANSWER

You can check using plugin description name as follows,

var pluginDescriptor = _pluginFinder.GetPluginDescriptorBySystemName("PluginSystemName");

If pluginDescriptoris null, plugin is not installed. Also note, you need to add reference of IPluginFinder interface in your class.