TJC.Singleton
0.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package TJC.Singleton --version 0.4.0
NuGet\Install-Package TJC.Singleton -Version 0.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TJC.Singleton" Version="0.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TJC.Singleton" Version="0.4.0" />
<PackageReference Include="TJC.Singleton" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TJC.Singleton --version 0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TJC.Singleton, 0.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TJC.Singleton@0.4.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TJC.Singleton&version=0.4.0
#tool nuget:?package=TJC.Singleton&version=0.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
This Singleton base & factory can be used to instantiate all Singletons at once.
SingletonBase
- 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
- This mock class shows a example use-case.
SingletonFactory
- Can be used to instantiate ALL classes that derive from SingletonBase.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (6)
Showing the top 5 NuGet packages that depend on TJC.Singleton:
| Package | Downloads |
|---|---|
|
TJC.Collection.Core
Collection of NuGet Packages |
|
|
TJC.GUI
Graphical User Interface Extensions |
|
|
TJC.ConsoleApplication
Console Application Utilities |
|
|
TJC.MVVM
Model-View-ViewModel |
|
|
TJC.VersionExtensions
Version Extensions |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.0 | 797 | 7/20/2025 |
| 0.5.6 | 981 | 4/15/2025 |
| 0.5.5 | 2,350 | 12/3/2024 |
| 0.5.4 | 129 | 12/3/2024 |
| 0.5.3 | 1,587 | 11/15/2024 |
| 0.5.2 | 701 | 11/10/2024 |
| 0.5.1 | 545 | 11/5/2024 |
| 0.5.0 | 502 | 11/5/2024 |
| 0.4.1 | 702 | 10/26/2024 |
| 0.4.0 | 1,933 | 10/20/2024 |
| 0.3.2 | 727 | 10/20/2024 |
| 0.3.1 | 597 | 10/16/2024 |
| 0.3.0 | 3,581 | 10/10/2024 |
| 0.2.0 | 554 | 10/9/2024 |
| 0.1.10 | 1,043 | 10/2/2024 |
| 0.1.9 | 462 | 9/29/2024 |
| 0.1.8 | 1,376 | 9/5/2024 |
| 0.1.7 | 548 | 9/5/2024 |
| 0.1.6 | 434 | 9/4/2024 |
| 0.1.5 | 157 | 9/3/2024 |
| 0.1.4 | 1,417 | 6/10/2024 |
| 0.1.3 | 145 | 6/2/2024 |
| 0.1.2 | 160 | 6/2/2024 |
| 0.1.1 | 156 | 5/31/2024 |
| 0.1.0 | 169 | 5/31/2024 |