public void ConfigureServices(IServiceCollection services, IConfigurationRoot configuration)
{
services.Configure<MvcOptions>(congig =>
{
var _pluginFinder = EngineContext.Current.Resolve<IPluginFinder>();
var _storeContext = EngineContext.Current.Resolve<IStoreContext>();
var pluginDescriptor = _pluginFinder.GetPluginDescriptorBySystemName("Misc.MyPlugin");
if (pluginDescriptor == null || _pluginFinder.AuthenticateStore(pluginDescriptor, _storeContext.CurrentStore.Id) == false)
return;
else
{
congig.Filters.Add<MyFilter>();
}
});
}
The code works but is it correct?