예제 #1
0
파일: DALFacade.cs 프로젝트: akiker/CV2
 /// <summary>
 ///     Used to initialize the database preemptively on first run.
 /// </summary>
 /// <summary>
 ///     Creates and returns a unit of work to the caller.
 ///     If a unit of work is already being used then it throws an exception.
 ///     Allows only one instance of unit of work to exists.
 /// </summary>
 /// <returns></returns>
 public IUnitOfWork GetUnitOfWork()
 {
     if (_unitOfWork != null)
         throw new Exception("A unit of work is already in use.");
     _context = new Cv2Context();
     _unitOfWork = new UnitOfWork(_context);
     return _unitOfWork;
 }
예제 #2
0
 public SoftwareController()
 {
     _db = new Cv2Context();
 }
예제 #3
0
파일: DALFacade.cs 프로젝트: akiker/CV2
 public void DisposeUnitOfWork()
 {
     if (_unitOfWork != null)
     {
         //If we do not own the connection, it should be already closed
         if (!KeepConnectionAlive)
         {
             if (_dbConnection != null)
                 throw new Exception("Database connection is not null in disconnected state.");
         }
         else if (_dbConnection == null || _dbConnection.State != ConnectionState.Open)
             throw new Exception("Database connection is not open in connected state.");
         _unitOfWork.Dispose();
         _unitOfWork = null;
         _context = null;
     }
 }
 public PermissionDetailsViewModelsController()
 {
        _db = new Cv2Context();
 }
예제 #5
0
 public DependenciesController()
 {
         _db = new Cv2Context();
 }
예제 #6
0
 public LicenseViewModelController()
 {
     _db = new Cv2Context();
 }
예제 #7
0
 public ConfigRecordController()
 {
         _db = new Cv2Context();
 }