public void ClaimReward(int id) { var reward = rewardRepository.GetReward(id); if (reward.GoldPrice > 0) { playerRepository.ChangeGold(reward.RewardCreatorId, -reward.GoldPrice); } if (reward.HonorPrice > 0) { playerRepository.ChangeHonor(reward.RewardCreatorId, -reward.HonorPrice); } playerRepository.SaveChanges(); }