1.2.2
New features:
#24 Allow configuring default plugin that is returned from DI
ASP.NET Core specific new feature which extends the AddPluginType-feature with an option to configure the default plugin type. Here's how this feature can be used:
Previously always resolved the first IOperator:
services.AddPluginType<IOperator>();
Now:
services.AddPluginType<IOperator>(configureDefault: option =>
{
option.DefaultType = (provider, types) => typeof(SumOperator);
});
Or:
services.AddPluginType<IOperator>();
services.Configure<DefaultPluginOption>(nameof(IOperator), option =>
option.DefaultType = (serviceProvider, implementingTypes) => typeof(MultiplyOperator));
Please view #24 for more details for the background of this feature.
Bug fixes:
#44 Unnecessary assembly loading
Fixed a bug which caused FolderPluginCatalog to load more assemblies than needed when FolderPluginCatalogOptions were used to define the type finding criteria.