Example #1
0
 public void RewardUser(int userId, int rewardId)
 {
     if (userId > 0 && rewardId > 0)
     {
         UserAndRewardModel userAndRewardModel = new UserAndRewardModel
         {
             UserId   = userId,
             RewardId = rewardId
         };
         _userAndRewards.Add(userAndRewardModel);
     }
     else
     {
         throw new ArgumentException();
     }
 }
Example #2
0
        public bool RemoveReward(int userId, int rewardId)
        {
            UserAndRewardModel userAndRewardModel = _userAndRewards.FirstOrDefault(x => (x.UserId == userId && x.RewardId == rewardId));

            return(_userAndRewards.Remove(userAndRewardModel));
        }