Beispiel #1
0
        internal string Delete(int id)
        {
            Review data = Get(id);

            _repo.Delete(id);
            return("Deleted Review");
        }
        internal String Delete(int id)
        {
            var original = GetById(id);

            if (original == null)
            {
                throw new Exception("Bad Request");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
        internal string Delete(int id)
        {
            var orginal = GetById(id);

            if (orginal == null)
            {
                throw new Exception("Invalid Id, Bad Request");
            }
            _repo.Delete(id);
            return("Sucessfully Deleted!");
        }
        public bool Delete(int id, string userId)
        {
            var data = FindById(id);

            if (data == null)
            {
                throw new System.Exception("Bad Request");
            }
            if (data.CreatorId != userId)
            {
                throw new System.Exception("Invalid Permissions");
            }
            _repo.Delete(id);
            return(true);
        }
        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");
        }
 public void RemoveReview(string username, ReviewDto review)
 {
     //TODO Check for permissions
     _reviewsRepository.Delete(ent => ent.ObjectId.ToString().Equals(review.Id));
 }