-7

How to implement singleton design pattern in C#?
Can anyone help me?

1 Answers1

-3

In singleton pattern, a class can only have one instance and provides access point to it globally.

public sealed class Singleton
{
     private static readonly Singleton _instance = new Singleton();
}
Florian
  • 5,918
  • 3
  • 47
  • 86
Sasan007
  • 215
  • 1
  • 9