This simple library implements assembly scanning in a generic and reusable way.
The generic nature of this library makes it suitable for multiple purposes, here are just a few examples.
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));
}
}