Hello, I'd like to use RegistrationBuilder to export all derived types:
I need to have an ability to apply metadata individually at class level:
public class Foo1 : IFoo
The way of importing parts is:
public IEnumerable<Lazy<IFoo, IFooMeta>> foos;
No parts are discovered, because of lack of metadata. I've read how attributes overwrite convention-based info -
link. However, it'd require adding an explicit ExportAttribute to each "Foo" class as well. Then, there is no point in having a RegistrationBuilder.
While I seem to understand the reasoning behind this design, my needs definitely fit in a convention - all classes implementing IFoo should be exported with their metadata. One work-around I can think of is:
where retrieveMetaFunc is a custom method that extracts required metadata from a type. I'm in search for a cleaner, built-in approach that'd eliminate the need for repetitive ExportAttributes on every class definition. For the sake of example something like
Notice I'm not able to use custom export attributes, because I have multiple IFooMeta on each exported part.