My open generic works fine when exported with an attribute, such as
[Export(typeof(IRepository
<>))]
publicclassExampleRepository<T> : IRepository<T>whereT : class
However, I haven't been able to work out how to export this with RegistrationBuilder. Neither of these work
builder.ForTypesDerivedFrom(typeof(IRepository<>)).ExportInterfaces();
builder.ForTypesDerivedFrom(typeof(IRepository<>)).Export(eb => eb.AsContractType(typeof(IRepository
<>)));Has anyone worked out how to export open generics from RegistrationBuilder?
Is it impossible?