コード例 #1
0
 public int CreateLynQer(LynQerEntity lynQerEntity)
 {
     //Registration change later
     using (var scope = new TransactionScope())
     {
         var lynQer = new LynQer
         {
             LynQName = lynQerEntity.LynQName
         };
         _unitOfWork.LynQerRepository.Insert(lynQer);
         _unitOfWork.Save();
         scope.Complete();
         return lynQer.Id;
     }
 }
コード例 #2
0
 public bool UpdateLynQer(int lynQerId, LynQerEntity lynQerEntity)
 {
     var success = false;
     if (lynQerEntity != null)
     {
         using (var scope = new TransactionScope())
         {
             var lynQer = _unitOfWork.LynQerRepository.GetByID(lynQerId);
             if (lynQer != null)
             {
                 lynQer.LynQName = lynQerEntity.LynQName;
                 _unitOfWork.LynQerRepository.Update(lynQer);
                 _unitOfWork.Save();
                 scope.Complete();
                 success = true;
             }
         }
     }
     return success;
 }