Пример #1
0
 public static TddUnitOfWork Get(TddEntities entities)
 {
     var res = new TddUnitOfWork {
         Entities = entities
     };
     return res;
 }
Пример #2
0
        public static TddUnitOfWork Get(TddEntities entities)
        {
            var res = new TddUnitOfWork {
                Entities = entities
            };

            return(res);
        }
Пример #3
0
 public bool TransferMoney(Account sender, Account recipient, int amount)
 {
     using (this._unitOfWork = this._unitOfWorkFactory.CreateUnitOfWork()) {
         if (AccountRepository.TransferMoney(sender, recipient, amount)) {
             this._unitOfWork.Commit();
             return true;
         }
         return false;
     }
 }
Пример #4
0
 public Account GetById(int id)
 {
     using (this._unitOfWork = this._unitOfWorkFactory.CreateUnitOfWork()) {
         return AccountRepository.GetById(id);
     }
 }
Пример #5
0
 public TddUnitOfWork CreateUnitOfWork()
 {
     return(TddUnitOfWork.Get(new TddEntities()));
 }
Пример #6
0
 public void SetContext(TddUnitOfWork unitOfWork)
 {
     this._context = unitOfWork.Entities;
 }
Пример #7
0
 public AccountRepository(TddUnitOfWork unitOfWork)
 {
     this._context = unitOfWork.Entities;
 }