Skip to content

GeneratedAssemblyProvider

NexusLabs.Needlr.Injection.SourceGen

NexusLabs.Needlr.Injection.SourceGen.Loaders

GeneratedAssemblyProvider Class

An assembly provider that derives assemblies from the generated TypeRegistry.

public sealed class GeneratedAssemblyProvider : NexusLabs.Needlr.Injection.IAssemblyProvider

Inheritance System.Object 🡒 GeneratedAssemblyProvider

Implements NexusLabs.Needlr.Injection.IAssemblyProvider

Remarks

When using source generation, the TypeRegistry contains all injectable types and plugins discovered at compile time. This provider extracts the unique assemblies from those types, enabling cross-assembly plugin discovery without runtime assembly scanning.

This provider should be used with GeneratedPluginFactory to ensure that all assemblies containing generated types are included in plugin discovery.

For assembly ordering, use SyringeExtensions.OrderAssemblies after configuring the Syringe.

Constructors

GeneratedAssemblyProvider(Func<IReadOnlyList<InjectableTypeInfo>>, Func<IReadOnlyList<PluginTypeInfo>>) Constructor

Initializes a new instance of the GeneratedAssemblyProvider class.

public GeneratedAssemblyProvider(System.Func<System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.Generators.InjectableTypeInfo>> injectableTypesProvider, System.Func<System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.Generators.PluginTypeInfo>> pluginTypesProvider);

Parameters

injectableTypesProvider System.Func<System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.Generators.InjectableTypeInfo>>

A function that returns the injectable types.

pluginTypesProvider System.Func<System.Collections.Generic.IReadOnlyList<NexusLabs.Needlr.Generators.PluginTypeInfo>>

A function that returns the plugin types.