I have coded a service like that :
public interface IMyInterface
{
...
}
[Export(typeof(IMyInterface))]
internal class MyService : IMyInterface
{
...
}
Now, I'd like to import several instances of MyService
with MEF in my main program.
How can I do that ?
With [Import] private IMyInterface MyService { get; set; }
I only get 1 instance of MyService
.
In my main program, I'd like to dynamically specify the number of imported instance of MyService
before MEF composition.
I don't want to use [ImportMany]
because I don't want to specify the number of export in my MyService
implementation.
Can you help me ?