Grace icon indicating copy to clipboard operation
Grace copied to clipboard

Question: Is there an attribute for [ExportNamed]?

Open secovel opened this issue 7 months ago • 0 comments

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;
    }

`

secovel avatar Jul 09 '24 12:07 secovel