Skip to content

BEagle1984/gas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NuGet Build Status GitHub license

Generic Assembly Scanner (aka Gas)

This simple library implements assembly scanning in a generic and reusable way.

Usage Examples

The generic nature of this library makes it suitable for multiple purposes, here are just a few examples.

.NET Core DI

using Gas;

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        AssemblyScanner
            .Scan(Assembly.GetExecutingAssembly())
            .ForEachConcreteClassImplementing<IService>()
                .ForEachImplementedInterface()
                .Do((classType, interfaceType) => 
                    services.AddScoped(interfaceType, classType))
            .ForEachConcreteClassImplementing<ITextParser>()
                .Do(t => services.AddScoped(typeof(ITextParser), t));
    }
}

About

Generic Assembly Scanner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages