SourceGenRegistry
NexusLabs.Needlr¶
NexusLabs.Needlr¶
SourceGenRegistry Class¶
Static registry for source-generated registrations.
Inheritance System.Object 🡒 SourceGenRegistry
Remarks¶
This class provides a decoupling layer between the core Needlr runtime and the
source-generated bootstrap code. The source generator emits a module initializer
that registers callbacks here, and the ConfiguredSyringe calls these
callbacks during BuildServiceProvider.
This allows NexusLabs.Needlr.Injection to have no dependency on
NexusLabs.Needlr.Generators.Attributes.
Methods¶
SourceGenRegistry.RegisterExtension(Action<object,object>) Method¶
Registers an extension registrar from extension packages.
Parameters¶
registrar System.Action<System.Object,System.Object>
Action that registers extension services. Parameters are (IServiceCollection, IConfiguration), typed as object to avoid package dependencies.
SourceGenRegistry.RegisterOptionsRegistrar(Action<object,object>) Method¶
Registers the options registrar from source-generated code.
Parameters¶
registrar System.Action<System.Object,System.Object>
Action that registers options. Parameters are (IServiceCollection, IConfiguration), typed as object to avoid package dependencies.
SourceGenRegistry.TryGetExtensionRegistrar(Action<object,object>) Method¶
Gets the extension registrar if one is registered.
Parameters¶
registrar System.Action<System.Object,System.Object>
Returns¶
SourceGenRegistry.TryGetOptionsRegistrar(Action<object,object>) Method¶
Gets the options registrar if one is registered.
Parameters¶
registrar System.Action<System.Object,System.Object>