Beispiel #1
0
 public ActionResult AddMoney(AddingUserMoneyViewModel model)
 {
     if (ModelState.IsValid)
     {
         var user = unitOfWork.UsersRepository.Get(User.Identity.GetUserId());
         user.MoneyLeft += model.MoneyToAdd;
         unitOfWork.Save();
     }
     return View(model);
 }
Beispiel #2
0
 public void AddMoney(AddingUserMoneyViewModel model)
 {
     unitOfWork.UsersRepository.Get(model.UserId).MoneyLeft += model.MoneyToAdd;
     unitOfWork.Save();
 }