예제 #1
0
        internal Item EditItem(Profile userInfo, Item editedItem)
        {
            Item oldItem = _repo.GetById(editedItem.Id);

            if (oldItem == null)
            {
                throw new Exception("Bad Id");
            }
            if (oldItem.CreatorId != userInfo.Id)
            {
                throw new Exception("You are not the original poster : Access denied");
            }
            _repo.EditItem(editedItem);
            return(_repo.GetById(editedItem.Id));
        }