Exemple #1
0
        public string Delete(int id, string userId)
        {
            Keep keep = Get(id, userId);            //Nullchecks

            _repo.Delete(id);
            return("Successfully delorted");
        }
Exemple #2
0
 internal string Delete(int id, string userId)
 {
     if (_repo.Delete(id, userId))
     {
         return("Keep successfully removed.");
     }
     throw new Exception("Could not delete keep");
 }
Exemple #3
0
        public void Delete(int id, string userId)
        {
            int k = _repo.Delete(id, userId);

            if (k == 0)
            {
                throw new Exception("You can't do that.");
            }
        }
Exemple #4
0
        public string Delete(string userId, int id)
        {
            bool isdDeleted = _repo.Delete(userId, id);

            if (!isdDeleted)
            {
                throw new Exception("Not the author of Keep!");
            }
            return("Keep Deleted!");
        }
        public String Delete(string userId, int id)
        {
            bool delorted = _repo.Delete(userId, id);

            if (!delorted)
            {
                throw new Exception("Not your keep to delete");
            }
            return("Deleted!");
        }
Exemple #6
0
        internal String Delete(int id, string userId)
        {
            var found = _repo.GetById(id);

            if (found == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
Exemple #7
0
        internal object Delete(int id, string userId)
        {
            var exists = _repo.GetKeepDeleteById(id, userId);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id, userId);
            return("Successfully Deleted");
        }
        public string Delete(int id, string userId)
        {
            Keep keep = _kr.Get(id);

            if (keep == null || keep.UserId != userId)
            {
                throw new Exception("Invalid Id");
            }
            _kr.Delete(id);
            return(" unkept man");
        }
Exemple #9
0
        internal string Delete(int id, string userId)
        {
            var data = GetById(id);

            if (data.CreatorId != userId)
            {
                throw new Exception("You must own this Keep to delete it.");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Exemple #10
0
        internal object Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid ID");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Exemple #11
0
        internal string Delete(int id)
        {
            var current = _repo.GetById(id);

            if (current == null)
            {
                throw new Exception("Invalid ID");
            }
            _repo.Delete(id);
            return("Successfully Deleted");
        }
Exemple #12
0
        internal object Delete(int id, string userId)
        {
            var existenceTest = _repo.GetById(id);

            if (existenceTest == null)
            {
                throw new Exception("Bad request or Id");
            }
            _repo.Delete(id, userId);
            return("Yay you deleted it");
        }
Exemple #13
0
        //string userId, userId,
        internal object Delete(string userId, int id)
        {
            GetById(userId, id);
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("You can't delete a Keep you don't own!");
            }
            return("Deleted!");
        }
Exemple #14
0
        public string Delete(int id, string userId)
        {
            Keep foundKeep = GetById(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("Unable to delete this Keep.");
            }
            _repo.Delete(id, userId);
            return("Successfully deleted Keep!");
        }
Exemple #15
0
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid Id");
            }
            _repo.Delete(id);
            return("It was deleted");
        }
Exemple #16
0
        public string Delete(string userId, int id)
        {
            GetById(id);
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("Sorry You No Own This!");
            }
            return("Deleted!");
        }
Exemple #17
0
        internal string Delete(int id, string userId)
        {
            Keep data = GetById(id);

            if (data.CreatorId != userId)
            {
                throw new Exception("Invalid Edit Permissions, This keep isn't yours to delete");
            }
            _keepsRepo.Delete(id);
            return("Keep Removed");
        }
        internal string Delete(int id)
        {
            var exists = _repo.GetById(id);

            if (exists == null)
            {
                throw new Exception("Invalid id.");
            }
            _repo.Delete(id);
            return("Successfully deleted");
        }
Exemple #19
0
        public string Delete(string userId, int id)
        {
            GetById(id);
            bool deleted = _repo.Delete(userId, id);

            if (!deleted)
            {
                throw new Exception("You are not the creator of this keep!");
            }
            return("Deleted!");
        }
        internal Keep Delete(int id, string userId)
        {
            Keep exists = Get(id);

            if (exists.UserId == userId)
            {
                _repo.Delete(id);
                return(exists);
            }
            throw new Exception("You cannot delete the given keep");
        }
Exemple #21
0
        public string Delete(int id, string userId)
        {
            Keep exists = _repo.Get(id);

            if (exists == null || exists.UserId != userId)
            {
                throw new Exception("doesn't exist broh");
            }
            _repo.Delete(id, userId);
            return("it's gone, Jim");
        }
Exemple #22
0
    }//endof keepcount

    internal Keep Delete(int id, string userId)
    {
      Keep found = Get(id);
      if (found.UserId != userId)
      {
        throw new Exception("Invalid Request");
      }
      if (_repo.Delete(id))
      {
        return found;
      }
      throw new Exception("Something went terribly wrong");
    }
Exemple #23
0
        internal string Delete(int id, string userId)
        {
            Keep foundKeep = GetById(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("That's not yours mang!");
            }
            if (_repo.Delete(id, userId))
            {
                return("successfully disposed of!");
            }
            throw new Exception("I don't even know man!");
        }
Exemple #24
0
        public Keep Delete(int id, string userId)
        {
            Keep found = GetById(id);

            if (found.UserId != userId)
            {
                throw new Exception("Invalid Request");
            }
            if (_repo.Delete(id))
            {
                return(found);
            }
            throw new Exception("Something is wrong here");
        }
Exemple #25
0
        internal string Delete(int id, string userId)
        {
            Keep found = Get(id, userId);

            if (found.UserId != userId)
            {
                throw new Exception("This isnt your keep homie.");
            }
            if (_repo.Delete(id, userId))
            {
                return("Successfully Deleted");
            }
            throw new Exception("Uh Oh something went wrong.");
        }
Exemple #26
0
        //!SECTION end PUT requests

        //SECTION DELETE requests

        internal string Delete(int id, string userId)
        {
            Keep foundKeep = GetById(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("This is not your keep!");
            }
            if (_repo.Delete(id, userId))
            {
                return("Deleted.  #GolfClap");
            }
            throw new Exception("You're gonna need a mulligan...it's not deleting");
        }
Exemple #27
0
        internal string Delete(int id, string userId)
        {
            Keep foundKeep = GetOne(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("This is not your keep!");
            }
            if (_repo.Delete(id, userId))
            {
                return("Sucessfully deleted.");
            }
            throw new Exception("Delete failed");
        }
Exemple #28
0
        // internal Keep Edit(Keep keepToUpdate, string userId)
        // {
        //   Keep foundKeep = GetById(keepToUpdate.Id);
        //   if (foundKeep.Keeps < keepToUpdate.Keeps)
        //   {
        //     if (_repo.IncrementKeeps(keepToUpdate))
        //     {
        //     keepToUpdate.Keeps = foundKeep.Keeps + 1;
        //     return keepToUpdate;
        //     // return _repo.IncrementKeeps(keepToUpdate);
        //     }
        //       throw new Exception(
        //         "You can't keep this.");
        //   }
        //   if (foundKeep.UserId == userId)
        //   {
        //     return keepToUpdate;
        //   }
        //   throw new Exception("You can't edit this keep.");
        //   // return _repo.IncrementKeeps(keepToUpdate);
        // }

        internal string Delete(int id, string userId)
        {
            Keep foundKeep = GetById(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("This is not your keep!");
            }
            if (_repo.Delete(id, userId))
            {
                return("Successfully Deleted.");
            }
            throw new Exception("Something didn't work.");
        }
Exemple #29
0
        internal Keep Delete(int id, string userId)
        {
            Keep found = Get(id);

            if (found.UserId != userId)
            {
                throw new Exception("Invalid Request");
            }
            if (_repo.Delete(id))
            {
                return(found);
            }
            throw new Exception("This Keep was not able to be deleted.");
        }
Exemple #30
0
        internal string Delete(int id, string userId) //Delete
        {
            Keep foundKeep = GetById(id);

            if (foundKeep.UserId != userId)
            {
                throw new Exception("That is not your post");
            }
            if (_repo.Delete(id, userId))
            {
                return("poof.");
            }
            throw new Exception("ruh roh");
        }