I have an ASP.Net Core 3.1 app and I have a number of plugins
that I load through MEF. The simplified interface looks like this:
public interface IImportPlugin
{
string Name { get; }
string Category { get; }
string Title { get; }
string Description { get; }
}
And a plugin class might look like this:
[Export(typeof(IImportPlugin))]
public sealed class ImportCustomers : IImportPlugin
{
private ICustomerService customerService;
//Other services...
[ImportingConstructor]
public ImportCustomers()
: base()
{
//Set properties
}
}
How can I inject instances of the services into the plugin?