title: Singleton for MongoDB
body: <p>Should i use singleton pattern for MongoDB. I'm currently building an Game Server for turnbase game using Photon Engine and MongoDB.</p>
  
  <pre><code>public sealed class GSEntities
  {
      #region Fields
      public IMongoClient Client;
      public IMongoDatabase Database;
  
      private static GSEntities _instance;
      private static readonly Object sync = new object();
  
      public static GSEntities Instance
      {
          get
          {
              if (_instance == null)
              {
                  lock (sync)
                  {
                      if (_instance == null)
                          _instance = new GSEntities();
                  }
              }
              return _instance;
          }
      }
  }
  </code></pre>
  
  <p>It's good or should i use other pattern like Repository ?</p>
  
  <p>Thanks for your helps ! :)</p>