public ContextWrapper(bool lazyLoadingEnabled)
 {
     _disposed = false;
     _manager  = new EntityConnectionManager();
     _context  = (TContext)Activator.CreateInstance(typeof(TContext), _manager.Connection);
     _context.ContextOptions.LazyLoadingEnabled = lazyLoadingEnabled;
 }
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         if (disposing)
         {
             if (_manager != null)
             {
                 _manager.Dispose();
                 _manager = null;
             }
             var ctx = _context as IDisposable;
             if (ctx != null)
             {
                 ctx.Dispose();
                 _context = null;
             }
         }
     }
     _disposed = true;
 }