Example #1
0
        public virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                // free other managed objects that implement
                // IDisposable only

                try
                {
                    if (_dataContext != null)
                    {
                        _dataContext.Dispose();
                        _dataContext = null;
                    }
                }
                catch (ObjectDisposedException)
                {
                    // do nothing, the objectContext has already been disposed
                }
            }

            // release any unmanaged objects
            // set the object references to null

            _disposed = true;
        }
Example #2
0
 public UnitOfWork()
 {
     _dataContext = new ProMetrixContext();
 }
Example #3
0
 public UnitOfWork(ProMetrixContext dataContext)
 {
     _dataContext = dataContext;
 }
Example #4
0
 public Repository(ProMetrixContext db)
 {
     Db = db;
 }