Skip to content

Question: Is there an attribute for [ExportNamed]? #318

@secovel

Description

@secovel

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

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions