Grace
Grace copied to clipboard
Question: Is there an attribute for [ExportNamed]?
Love your lib, been using it for YEARS.
I tried to use [ExportKeyedType] but I don't know the type before hand. I really need [ExportNamed].
If it doesn't exist how can I add it without having to resort to reflection scans of an assembly in order to manually register the classes?
I'm using the code to automatically register based on Attributes.
`
public static IInjectionScope GraceExportInstancesToContainer(this IInjectionScope scope, Assembly assemblyToExport = null)
{
scope.Configure(regbuilder =>
{
Assembly assembly;
if (assemblyToExport == null)
{
assembly = Assembly.GetEntryAssembly();
}
else
{
assembly = assemblyToExport;
}
regbuilder.ExportAssembly(assembly).ExportAttributedTypes();
});
return scope;
}
`