Skip to content

ASP.NET Core Scrutor extension for automatic registration of classes inherited from IScopedLifetime, ISelfScopedLifetime, ITransientLifetime, ISelfTransientLifetime, ISingletonLifetime, ISelfSingletonLifetime

License

Notifications You must be signed in to change notification settings

sefacan/Scrutor.AspNetCore

Repository files navigation

Scrutor.AspNetCore

ASP.NET Core Scrutor extension for automatic registration of classes inherited from IScopedLifetime, ISelfScopedLifetime, ITransientLifetime, ISelfTransientLifetime, ISingletonLifetime, ISelfSingletonLifetime

Build Status

Build server Platform Status
Azure CI Pipelines All
Github Actions All
Travis CI Linux

Installation

Install the Scrutor.AspNetCore NuGet Package.

Package Manager Console

Install-Package Scrutor.AspNetCore

.NET Core CLI

dotnet add package Scrutor.AspNetCore

Usage

public void ConfigureServices(IServiceCollection services)
{
    //add to the end of the method
    services.AddAdvancedDependencyInjection();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    //add to the end of the method
    app.UseAdvancedDependencyInjection();
}

//usage without constructor classes
var service = ServiceLocator.Context.GetService<MyClass>();

About

ASP.NET Core Scrutor extension for automatic registration of classes inherited from IScopedLifetime, ISelfScopedLifetime, ITransientLifetime, ISelfTransientLifetime, ISingletonLifetime, ISelfSingletonLifetime

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages