Jinget.Core.DiScanner 8.0.55

Prefix Reserved
dotnet add package Jinget.Core.DiScanner --version 8.0.55
                    
NuGet\Install-Package Jinget.Core.DiScanner -Version 8.0.55
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Jinget.Core.DiScanner" Version="8.0.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jinget.Core.DiScanner" Version="8.0.55" />
                    
Directory.Packages.props
<PackageReference Include="Jinget.Core.DiScanner" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Jinget.Core.DiScanner --version 8.0.55
                    
#r "nuget: Jinget.Core.DiScanner, 8.0.55"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Jinget.Core.DiScanner@8.0.55
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Jinget.Core.DiScanner&version=8.0.55
                    
Install as a Cake Addin
#tool nuget:?package=Jinget.Core.DiScanner&version=8.0.55
                    
Install as a Cake Tool

Jinget.Core.DiScanner

Using this library, you can easily register your source code dependencies automatically without the need to write repetitive and annoying codes.

Attention: This package is build based on Autofac assembly scanning.

How to Use:

Download the package from NuGet using Package Manager: Install-Package Jinget.Core.DiScanner You can also use other methods supported by NuGet. Check Here for more information.

Methods

Assembly Selector

Name Description
FromCallingAssembly Will scan for types from the calling assembly
FromExecutingAssembly Will scan for types from the currently executing assembly
FromEntryAssembly Will scan for types from the entry assembly
FromApplicationDependencies Will load and scan all runtime libraries referenced by the currently executing application
FromAssemblyDependencies Will load and scan all runtime libraries referenced by the currently specified assembly
FromDependencyContext Will load and scan all runtime libraries in the given context
FromAssemblyOf Will scan for types from the assembly of type T
FromAssemblies Will scan for types in each Assembly in assemblies

Service Type Selector

Name Description
AsSelf Registers each matching concrete type as itself
FromExecutingAssembly Will scan for types from the currently executing assembly
As Registers each matching concrete type
AsImplementedInterfaces Registers each matching concrete type as all of its implemented interfaces
AsSelfWithInterfaces Registers each matching concrete type as all of its implemented interfaces, by returning an instance of the main type
AsMatchingInterface Registers the type with the first found matching interface name. (e.g. ClassName is matched to IClassName)
UsingAttributes Registers each matching concrete type according to their ServiceDescriptorAttribute

Implementation Type Selector

Name Description
AddClasses Adds all non-abstract classes from the selected assemblies to the Microsoft.Extensions.DependencyInjection.IServiceCollection

Lifetime Selector

Name Description
WithSingletonLifetime Registers each matching concrete type with ServiceLifetime.Singleton lifetime
WithScopedLifetime Registers each matching concrete type with ServiceLifetime.Scoped lifetime
WithTransientLifetime Registers each matching concrete type with ServiceLifetime.Transient lifetime
WithLifetime Registers each matching concrete type with the specified lifetime

Samples

You can view more detailed sample by referring to Jinget.CoreDiScanner.Test project. View UnitTests

Sample 1:

Will scan for types from the calling assembly.

_services.Scan(
    s => s.FromCallingAssembly()
        .AddClasses()
        .AsImplementedInterfaces()
        .WithTransientLifetime());

The above code will scan the calling assembly and registers each matching concrete type as all of its implemented interfaces. WithTransientLifetime indicates that the services should have Transient lifetime.

Sample 2:

Will scan for types from the calling assembly.

_services.Scan(
    s => s.FromExecutingAssembly()
        .AddClasses()
        .AsImplementedInterfaces()
        .WithTransientLifetime());

The above code will scan for types from the currently executing assembly, and registers each matching concrete type as all of its implemented interfaces.

Sample 3:

_services.Scan(
    s => s.FromAssembliesOf(typeof(Sample))
        .AddClasses()
        .AsSelfWithInterfaces()
        .WithSingletonLifetime());

The above code will scan the assembly containing the Sample type and registers each matching concrete type as all of its implemented interfaces, by returning an instance of the main type

Sample 4:

_services.Scan(
    s => s.FromAssemblies(typeof(ICustomInterface).Assembly, typeof(ISelector).Assembly)
        .AddClasses()
        .AsImplementedInterfaces()
        .WithTransientLifetime());

The above code will scan for types in each assembly in assemblies, and registers each matching concrete type as all of its implemented interfaces, by returning an instance of the main type


How to install

In order to install Jinget.Core.DiScanner please refer to nuget.org

Contact Me

👨‍💻 Twitter: https://twitter.com/_jinget

📧 Email: farahmandian2011@gmail.com

📣 Instagram: https://www.instagram.com/vahidfarahmandian

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.55 300 12/16/2025
8.0.54 218 11/22/2025
8.0.53 199 11/3/2025
8.0.52 194 10/13/2025
8.0.51 219 9/24/2025
8.0.50 202 9/11/2025
8.0.49 191 9/8/2025
8.0.48 174 9/8/2025
8.0.47 188 9/7/2025
8.0.46 134 8/22/2025
8.0.45 185 7/31/2025
8.0.44 163 7/31/2025
8.0.43 162 7/30/2025
8.0.42 161 7/30/2025
8.0.41 167 7/30/2025
8.0.40 164 7/30/2025
8.0.39 155 7/29/2025
8.0.38 158 7/28/2025
8.0.37 158 7/28/2025
8.0.36 172 7/28/2025
8.0.36-preview005 166 7/27/2025
8.0.35 127 7/19/2025
8.0.34 117 7/18/2025
8.0.33 209 6/29/2025
8.0.32 193 6/29/2025
8.0.31 146 6/28/2025
8.0.30 116 6/27/2025
8.0.29 127 6/27/2025
8.0.28 124 6/27/2025
8.0.27 154 6/27/2025
8.0.26 199 6/21/2025
8.0.25 196 6/15/2025
8.0.25-preview001 178 6/15/2025
8.0.24 192 5/31/2025
8.0.23 191 5/28/2025
8.0.23-preview001 190 5/28/2025
8.0.22 205 5/25/2025
8.0.21 216 5/11/2025
8.0.20 188 5/11/2025
8.0.19 190 5/11/2025
8.0.18 238 4/21/2025
8.0.17 230 4/21/2025
8.0.16 150 4/19/2025
8.0.15 286 4/13/2025
8.0.14 234 4/7/2025
8.0.13 219 4/7/2025
8.0.12 159 4/5/2025
8.0.11 256 3/9/2025
8.0.10 234 3/9/2025
8.0.9 231 3/9/2025
8.0.8 214 2/27/2025
8.0.7 192 2/27/2025
8.0.6 178 2/27/2025
8.0.5 169 2/26/2025
8.0.4 158 2/25/2025
8.0.3 174 2/24/2025
8.0.2 163 2/24/2025
8.0.1 185 2/20/2025
8.0.0 202 1/22/2025
8.0.0-preview013 248 12/19/2024
8.0.0-preview012 152 12/19/2024
8.0.0-preview011 154 12/17/2024
8.0.0-preview010 168 12/16/2024
8.0.0-preview009 158 12/15/2024
8.0.0-preview008 174 11/25/2024
8.0.0-preview007 184 11/11/2024
8.0.0-preview006 155 11/2/2024
8.0.0-preview005 143 11/2/2024
8.0.0-preview004 134 11/1/2024
8.0.0-preview003 148 11/1/2024
8.0.0-preview002 148 11/1/2024
8.0.0-preview001 143 11/1/2024
6.2.23-preview003 148 10/31/2024
6.2.23-preview002 147 10/31/2024
6.2.22 185 10/26/2024
6.2.21 167 10/26/2024
6.2.20 158 10/26/2024
6.2.19-preview037 132 10/14/2024
6.2.19-preview036 144 9/30/2024
6.2.19-preview035 162 9/10/2024
6.2.19-preview034 165 9/9/2024
6.2.19-preview033 165 9/1/2024
6.2.19-preview032 163 9/1/2024
6.2.19-preview031 159 8/31/2024
6.2.19-preview029 147 8/26/2024
6.2.19-preview028 178 8/26/2024
6.2.19-preview027 164 8/26/2024
6.2.19-preview026 193 8/21/2024
6.2.19-preview025 181 8/21/2024
6.2.19-preview024 188 8/19/2024
6.2.19-preview023 181 8/8/2024
6.2.19-preview022 181 8/8/2024
6.2.19-preview021 162 8/5/2024
6.2.19-preview020 170 8/5/2024
6.2.19-preview019 156 8/5/2024
6.2.19-preview018 152 8/3/2024
6.2.19-preview017 126 7/30/2024
6.2.19-preview016 148 7/29/2024
6.2.19-preview015 140 7/29/2024
6.2.19-preview014 136 7/26/2024
6.2.19-preview013 175 7/20/2024
6.2.19-preview012 167 7/20/2024
6.2.19-preview011 180 6/15/2024
6.2.19-preview010 183 6/14/2024
6.2.19-preview009 169 6/14/2024
6.2.19-preview008 175 6/13/2024
6.2.19-preview007 166 6/13/2024
6.2.19-preview006 154 6/13/2024
6.2.19-preview005 162 6/13/2024
6.2.19-preview004 152 6/13/2024
6.2.19-preview003 158 6/11/2024
6.2.19-preview002 163 6/8/2024
6.2.19-preview001 158 6/8/2024
6.2.18 211 6/6/2024
6.2.18-preview020 168 6/6/2024
6.2.18-preview019 171 6/6/2024
6.2.18-preview018 173 6/6/2024
6.2.18-preview017 170 6/2/2024
6.2.18-preview016 171 6/1/2024
6.2.18-preview015 186 5/28/2024
6.2.18-preview014 168 5/28/2024
6.2.18-preview013 178 5/28/2024
6.2.18-preview012 162 5/28/2024
6.2.18-preview011 186 5/26/2024
6.2.18-preview010 192 5/26/2024
6.2.18-preview009 180 5/26/2024
6.2.18-preview008 177 5/26/2024
6.2.18-preview007 203 5/22/2024
6.2.18-preview006 190 5/22/2024
6.2.18-preview005 187 5/19/2024
6.2.18-preview004 184 5/19/2024
6.2.18-preview003 167 5/19/2024
6.2.18-preview002 155 5/19/2024
6.2.17 193 5/19/2024
6.2.16 211 5/18/2024
6.2.15 216 5/18/2024
6.2.14 191 5/18/2024
6.2.13 211 5/17/2024
6.2.12 204 5/17/2024
6.2.11 212 5/17/2024
6.2.10 203 5/17/2024
6.2.9 179 5/12/2024
6.2.8 179 5/9/2024
6.2.7 160 5/9/2024
6.2.6 210 5/7/2024
6.2.5 188 4/24/2024
6.2.4 208 2/1/2024
6.2.3 178 2/1/2024
6.2.2 178 1/31/2024
6.2.1 204 1/23/2024
6.2.0 186 1/23/2024
6.2.0-preview013 166 1/19/2024