Skip to content

ScrutorTypeRegistrar

NexusLabs.Needlr.Injection.Scrutor

ScrutorTypeRegistrar Class

Registers types from assemblies using Scrutor.

public sealed class ScrutorTypeRegistrar : NexusLabs.Needlr.Injection.ITypeRegistrar

Inheritance System.Object 🡒 ScrutorTypeRegistrar

Implements NexusLabs.Needlr.Injection.ITypeRegistrar

Remarks

Scrutor does not traverse up the inheritance hierarchy of interfaces to look for the NexusLabs.Needlr.DoNotAutoRegisterAttribute. As a result, types that implement an interface with this attribute will still be registered unless the attribute is applied directly to the type itself.

Methods

ScrutorTypeRegistrar.RegisterTypesFromAssemblies(IServiceCollection, ITypeFilterer, IReadOnlyList<Assembly>) Method

Registers types from the specified assemblies into the service collection.

public void RegisterTypesFromAssemblies(Microsoft.Extensions.DependencyInjection.IServiceCollection services, NexusLabs.Needlr.Injection.ITypeFilterer typeFilterer, System.Collections.Generic.IReadOnlyList<System.Reflection.Assembly> assemblies);

Parameters

services Microsoft.Extensions.DependencyInjection.IServiceCollection

The service collection to register types into.

typeFilterer NexusLabs.Needlr.Injection.ITypeFilterer

The type filterer used to determine which types should be registered and their lifetimes.

assemblies System.Collections.Generic.IReadOnlyList<System.Reflection.Assembly>

The assemblies to scan for types to register.

Implements RegisterTypesFromAssemblies(IServiceCollection, ITypeFilterer, IReadOnlyList<Assembly>)