Пример #1
0
        internal void Delete(int id, Profile userInfo)
        {
            var data = _repo.GetById(id);

            if (data.CreatorId != userInfo.Id)
            {
                throw new Exception("Invalid Permissions to Delete");
            }
            _repo.Delete(id);
        }
Пример #2
0
        internal void Delete(int id)
        {
            var data = _repo.GetById(id);

            if (data == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id);
        }