public IActionResult Delete(int id) { //authentication var userId = Int32.Parse(User.FindFirst("UserId").Value); try { petManager.DeletePet(id, userId); return(Ok()); } catch (CustomDbConflictException e) { return(BadRequest(e.Message)); } }
public void CanDeletePet() { int petID = 999991; Pet pet = new Pet() { PetID = petID, PetName = "PetName", Gender = "Male", Species = "Lion", PetTypeID = "Cat", GuestID = 123456 }; _petManager.CreatePet(pet); _petManager.DeletePet(999991); _petManager.RetrieveAllPets(); }