public string Delete(int id, string userId) { Keep keep = Get(id, userId); //Nullchecks _repo.Delete(id); return("Successfully delorted"); }
internal string Delete(int id, string userId) { if (_repo.Delete(id, userId)) { return("Keep successfully removed."); } throw new Exception("Could not delete keep"); }
public void Delete(int id, string userId) { int k = _repo.Delete(id, userId); if (k == 0) { throw new Exception("You can't do that."); } }
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!"); }
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"); }
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"); }
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"); }
internal object Delete(int id) { var exists = _repo.GetById(id); if (exists == null) { throw new Exception("Invalid ID"); } _repo.Delete(id); return("Successfully Deleted"); }
internal string Delete(int id) { var current = _repo.GetById(id); if (current == null) { throw new Exception("Invalid ID"); } _repo.Delete(id); return("Successfully Deleted"); }
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"); }
//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!"); }
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!"); }
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"); }
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!"); }
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"); }
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"); }
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"); }
}//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"); }
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!"); }
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"); }
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."); }
//!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"); }
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"); }
// 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."); }
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."); }
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"); }