コード例 #1
0
        public void RemoveAwardFromUser(Guid userId, Guid awardId)
        {
            Award award = awards.Find(x => x.id == awardId);

            if (award == null)
            {
                throw new ArgumentOutOfRangeException($"No award with {awardId} found");
            }

            User user = users.Find(x => x.id == userId);

            if (user == null)
            {
                throw new ArgumentOutOfRangeException($"No user with {userId} found");
            }
            award.RemoveOwner(userId);
            user.RemoveAward(awardId);
        }