Question: Getting used to some new code and have a question. All over it, I am seeing the following

file1.cs :

```
MyClass myInstance = MyClass.Instance();

```

...and then in the definition of MyClass there is...

MyClass.cs : 

```
public class MyClass {

   // etc. etc.

   static readonly MyClass _instance = new MyClass();

   public static MyClass Instance() {
      return _instance;
   }

   // etc. etc.

}

```

What's the reason for doing that as opposed to just in file1.cs :

```
MyClass myInstance = new MyClass();

```

?

Answer: 
This is the *singleton pattern*. That's why a method is used to get the instance. 

Singleton pattern is used, when we want only one instance of a class be used in our app. We don't want the consumers of our app have the right to build more than one instances. 

For a detailed description of the singleton pattern, please have a look [here](http://en.wikipedia.org/wiki/Singleton_pattern).
I would advise you to use a property instead of a function. It is cleaner, more convenient for debugging and mock testing.

Note that by using a static constructor (as you are already doing), the initialization of `_instance`is thread-safe. 

Note : The implementation of the other methods should not be static.

Find below the complete implementation of the singleton pattern:

```
public class MyClass
{

    static MyClass _instance = new MyClass();

    public static MyClass Instance
    {
        get
        {
            return _instance;
        }
        set { _instance = value; }
    }

    public void DoStuff()
    {
         //etc...
    }

    private MyClass()
    {

    }
}

```

And you use it in other classes this way : 

```
 MyClass.Instance.DoStuff();

```