internal object Delete(int id, string creatorId) { Keep original = _repo.GetById(id); if (original == null) { throw new Exception("Invalid Id"); } // if (original.CreatorId != creatorId) { throw new Exception("Access Denied... This is not yours"); } _repo.Remove(id); return("succesfully delorted"); }
internal object Delete(int id, string userId) { Keep original = _repo.GetById(id); if (original == null) { throw new Exception("Invalid Id"); } if (original.CreatorId != userId) { throw new Exception("You cannot delete that which is not yours"); } _repo.Remove(id); return(original); }
internal object Delete(int keepId, string userId) { ViewModelKeep original = _repo.GetById(keepId); if (original == null) { throw new Exception("Invalid Id"); } if (original.CreatorId != userId) { throw new Exception("Access Denied. This is not yours"); } _repo.Remove(keepId); return("Succesfully Delorted"); }