Would you use an attribute that registers your interface/classes with .nets IoC container?

This page summarizes the projects mentioned and recommended in the original post on /r/dotnet

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • Scrutor

    Assembly scanning and decoration extensions for Microsoft.Extensions.DependencyInjection

    I much prefer using Scrutor and asbly scanning myself. https://github.com/khellang/Scrutor

  • sourceinject

    A source generator for C# that uses Roslyn (the C# compiler) to allow you to generate your dependencies injection during compile time.

    Something like this?

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • Canister

    Canister is a simple C# library aimed at enhancing the built-in IoC container in .NET. It enables you to effortlessly add all objects of a specified type and introduces the concept of modules to automatically wire up your system. With Canister, managing dependencies becomes a breeze, allowing you to focus on writing maintainable code.

    Back before .net had a default IoC container, I built this functionality in my own container. I built it so modules could automatically wire themselves up. Just add the library and go. Now that there is a default, it lives on as an extension method/set of classes to give the same functionality. It just extends the ServiceCollection now.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts