/// <summary>
 /// Returns a thread safe instance.
 /// </summary>
 public static InvoiceServiceAgent Instance()
 {
     if (_instance.IsNull()) {
         lock (_lock) {
             Thread.MemoryBarrier();
             if (_instance.IsNull()) {
                 _instance = new InvoiceServiceAgent();
             }
         }
     }
     return _instance;
 }
 /// <summary>
 /// Returns a thread safe instance.
 /// </summary>
 public static InvoiceServiceAgent Instance()
 {
     if (_instance.IsNull())
     {
         lock (_lock) {
             Thread.MemoryBarrier();
             if (_instance.IsNull())
             {
                 _instance = new InvoiceServiceAgent();
             }
         }
     }
     return(_instance);
 }