The meaning of life is to explore the world

C# Dependency Injection and Singleton

Posted on By Jason Liu

  1. Why Singleton class needs to be sealed?
    https://dotnettutorials.net/lesson/singleton-class-sealed/
    In short, internal derived class will be able to create instances.

  2. .NET DI framework list.
    https://www.claudiobernasconi.ch/2019/01/24/the-ultimate-list-of-net-dependency-injection-frameworks/

    Framework Comment
    Spring.NET Famous
    Unity Container Supports .NET core, exception management, logging
    Autofac Supports .NET core
    Ninject Lightweight, easy
  3. Singleton vs Dependency Injection.
    https://enterprisecraftsmanship.com/posts/singleton-vs-dependency-injection/
    In short, Singleton is better for ambient dependencies, i.e. dependencies used everywhere