< Summary

Information
Class: NexusLabs.Needlr.Injection.Scrutor.SyringeScrutorExtensions
Assembly: NexusLabs.Needlr.Injection.Scrutor
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection.Scrutor/SyringeScrutorExtensions.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 41
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UsingScrutorTypeRegistrar(...)100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.Injection.Scrutor/SyringeScrutorExtensions.cs

#LineLine coverage
 1using NexusLabs.Needlr.Injection;
 2
 3namespace NexusLabs.Needlr.Injection.Scrutor;
 4
 5/// <summary>
 6/// Extension methods for configuring <see cref="ConfiguredSyringe"/> instances with Scrutor-specific functionality.
 7/// </summary>
 8/// <remarks>
 9/// Scrutor uses runtime reflection for assembly scanning.
 10/// For AOT/trimming compatibility, use source-generated components instead.
 11/// </remarks>
 12/// <example>
 13/// Reflection-based usage with Scrutor:
 14/// <code>
 15/// var serviceProvider = new Syringe()
 16///     .UsingReflection()
 17///     .UsingScrutorTypeRegistrar()
 18///     .BuildServiceProvider();
 19/// </code>
 20/// </example>
 21public static class SyringeScrutorExtensions
 22{
 23    /// <summary>
 24    /// Configures the syringe to use the Scrutor type registrar.
 25    /// This enables automatic service registration using the Scrutor library for assembly scanning.
 26    /// </summary>
 27    /// <param name="syringe">The configured syringe to update.</param>
 28    /// <returns>A new configured syringe instance.</returns>
 29    /// <example>
 30    /// <code>
 31    /// var syringe = new Syringe()
 32    ///     .UsingReflection()
 33    ///     .UsingScrutorTypeRegistrar();
 34    /// </code>
 35    /// </example>
 36    public static ConfiguredSyringe UsingScrutorTypeRegistrar(this ConfiguredSyringe syringe)
 37    {
 2938        ArgumentNullException.ThrowIfNull(syringe);
 2839        return syringe.UsingTypeRegistrar(new ScrutorTypeRegistrar());
 40    }
 41}