Exemple #1
0
        internal Party Edit(Party editData, string userId)
        {
            Party original = GetById(editData.Id);

            if (original.creatorId != userId)
            {
                throw new Exception("Access Denied: Cannot Edit a Party You did not Create");
            }
            return(_repo.Edit(editData));
        }
        internal Party Edit(Party updated)
        {
            Party original = GetById(updated.Id);

            if (updated.CreatorId != original.CreatorId)
            {
                throw new Exception("You cannot edit this.");
            }
            updated.Name = updated.Name != null ? updated.Name : original.Name;
            return(_repo.Edit(updated));
        }