示例#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;
 }