예제 #1
0
        internal string Delete(int id, string userId)
        {
            var original = GetById(id);

            if (original.CreatorId != userId)
            {
                throw new Exception("Invalid Delete Permissions");
            }
            _repo.Delete(id);
            return("delorted");
        }
예제 #2
0
        internal String Delete(int id)
        {
            var original = GetById(id);

            if (original == null)
            {
                throw new Exception("Bad Request");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
예제 #3
0
        internal String Delete(int id, string userId)
        {
            var original = GetById(id);

            if (original == null)
            {
                throw new Exception("Bad Request");
            }
            if (original.CreatorId != userId)
            {
                throw new Exception("Invalid Permissions");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }