How to resolve ISettingService at NopStartup of plugin.

4 months ago
Below is the plugin NopStartUp, where I need to resolve the ISettingService but it is null.  I can not reduce the Order properties as I am overriding some default services from my plugin.



namespace Nop.Plugin.Misc.MyPlugin.Infrastructure
{
    public class NopStartup : INopStartup
    {  
        public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
       {
            var _settingService = EngineContext.Current.Resolve<ISettingService>();
            var _theSettings = EngineContext.Current.Resolve<MyPluginSettings>();

                  ...............................
                 .........................................
      }

public void Configure(IApplicationBuilder application)
{
}

public int Order => 3000;

}
4 months ago
You can use AppSettings to store some settings that you need before the DI is initialized (when the ISettingService becomes available).