title: C# Singleton Pattern
body: <p>I use the singleton pattern in a lot of places, sometimes the constructor does nothing, other times it's initialising things.
  I wondered if there was a way to set up an abstract class to minimise my code repetition a bit, i.e. I don't need <code>public static readonly Singleton _Instance = new Singleton();</code> in every single class, just one base class.
  I understand interfaces are not an option.</p>
  
  <p>I've tried using the following (taken from <a href="https://stackoverflow.com/a/4491859/1222199">here</a>);</p>
  
  <pre><code>public abstract class Singleton&lt;T&gt; where T : new()
  {
      static Singleton()
      {
      }
  
      private static readonly T _Instance = new T();
  
      public static T Instance
      {
          get { return _Instance; }
      }
  }
  </code></pre>
  
  <p>The problem with this is that I can't override the constructor for the cases where I need to initialise things.
  Is what I'm trying to do even possible? Or should I just keep doing what I'm doing and not worry about a base singleton class?</p>