Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 1.42 KB

README.md

File metadata and controls

45 lines (33 loc) · 1.42 KB

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>();