/TJC.Singleton

Singleton Base

Primary LanguageC#MIT LicenseMIT

NuGet Version and Downloads count

This singleton base & factory can be used to instantiate all singletons at once.


  • Ensures that only one instance of a derived class will exist.
  • This is implemented in a thread-safe way using Lazy.
  • It also ensures that the derived class has a private or protected constructor by throwing an exception at run-time.

Examples


  • Can be used to instantiate ALL classes that derive from SingletonBase.