Scrutor alternatives and similar packages
Based on the "IoC" category.
Alternatively, view Scrutor alternatives based on common mentions on social networks and blogs.
Autofac9.0 3.5 L5 Scrutor VS AutofacAn addictive .NET IoC container
Ninject8.4 2.7 L4 Scrutor VS Ninjectthe ninja of .net dependency injectors
Unity7.5 0.0 L4 Scrutor VS UnityThis repository contains all relevant information about Unity Container suit
Castle Windsor7.4 3.1 L5 Scrutor VS Castle WindsorCastle Windsor is a best of breed, mature Inversion of Control container available for .NET
Microsoft.Extensions.DependencyInjectionThe default IoC container for ASP.NET Core applications.
StructureMap6.6 0.0 L4 Scrutor VS StructureMapA Dependency Injection/Inversion of Control tool for .NET
Simple Injector6.5 4.3 L4 Scrutor VS Simple InjectorAn easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
TinyIoC6.3 0.0 L2 Scrutor VS TinyIoCAn easy to use, hassle free, Inversion of Control Container for small projects, libraries and beginners alike.
DryIoc6.0 7.4 Scrutor VS DryIocDryIoc is fast, small, full-featured IoC Container for .NET
DryIoc is fast, small, full-featured IoC Container for .NETDryIoc is fast, small, full-featured IoC Container for .NET
LightInject5.5 0.0 L2 Scrutor VS LightInjectAn ultra lightweight IoC container
Lamar5.1 0.0 Scrutor VS LamarFast Inversion of Control Tool and Successor to StructureMap
VS MEF4.7 4.6 Scrutor VS VS MEFManaged Extensibility Framework (MEF) implementation used by Visual Studio
Meet Grace4.0 0.0 Scrutor VS Meet GraceGrace is a feature rich dependency injection container library
Stashbox2.9 3.2 Scrutor VS StashboxA lightweight, fast, and portable dependency injection framework for .NET-based solutions.
Simplify.DI1.5 8.4 Scrutor VS Simplify.DISimplify is an open-source set of lightweight .NET libraries that provide infrastructure for your applications. DI and mocking friendly.
ServiceLayer1.1 0.0 Scrutor VS ServiceLayerDesign and Implement ServiceLayer that Integrated With FluentValidation
AdaskoTheBeAsT.FluentValidation.SimpleInjectorFluentValidation extensions to SimpleInjector
AdaskoTheBeAsT.AutoMapper.SimpleInjectorAutoMapper extensions to SimpleInjector
ONLYOFFICE Docs — document collaboration in your environment
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Scrutor or a related project?
Scrutor - I search or examine thoroughly; I probe, investigate or scrutinize
From scrūta, as the original sense of the verb was to search through trash. - https://en.wiktionary.org/wiki/scrutor
Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection
Install the Scrutor NuGet Package.
Package Manager Console
.NET Core CLI
dotnet add package Scrutor
The library adds two extension methods to
Scan- This is the entry point to set up your assembly scanning.
Decorate- This method is used to decorate already registered services.
See Examples below for usage examples.
var collection = new ServiceCollection(); collection.Scan(scan => scan // We start out with all types in the assembly of ITransientService .FromAssemblyOf<ITransientService>() // AddClasses starts out with all public, non-abstract types in this assembly. // These types are then filtered by the delegate passed to the method. // In this case, we filter out only the classes that are assignable to ITransientService. .AddClasses(classes => classes.AssignableTo<ITransientService>()) // We then specify what type we want to register these classes as. // In this case, we want to register the types as all of its implemented interfaces. // So if a type implements 3 interfaces; A, B, C, we'd end up with three separate registrations. .AsImplementedInterfaces() // And lastly, we specify the lifetime of these registrations. .WithTransientLifetime() // Here we start again, with a new full set of classes from the assembly above. // This time, filtering out only the classes assignable to IScopedService. .AddClasses(classes => classes.AssignableTo<IScopedService>()) // Now, we just want to register these types as a single interface, IScopedService. .As<IScopedService>() // And again, just specify the lifetime. .WithScopedLifetime() // Generic interfaces are also supported too, e.g. public interface IOpenGeneric<T> .AddClasses(classes => classes.AssignableTo(typeof(IOpenGeneric<>))) .AsImplementedInterfaces() // And you scan generics with multiple type parameters too // e.g. public interface IQueryHandler<TQuery, TResult> .AddClasses(classes => classes.AssignableTo(typeof(IQueryHandler<,>))) .AsImplementedInterfaces());
var collection = new ServiceCollection(); // First, add our service to the collection. collection.AddSingleton<IDecoratedService, Decorated>(); // Then, decorate Decorated with the Decorator type. collection.Decorate<IDecoratedService, Decorator>(); // Finally, decorate Decorator with the OtherDecorator type. // As you can see, OtherDecorator requires a separate service, IService. We can get that from the provider argument. collection.Decorate<IDecoratedService>((inner, provider) => new OtherDecorator(inner, provider.GetRequiredService<IService>())); var serviceProvider = collection.BuildServiceProvider(); // When we resolve the IDecoratedService service, we'll get the following structure: // OtherDecorator -> Decorator -> Decorated var instance = serviceProvider.GetRequiredService<IDecoratedService>();