public IActionResult DeleteStory(int id) { // Get the story with the same id var story = repo.GetStoryByID(id); // If story exists, remove from context if (story != null) { repo.DeleteStory(id); return(NoContent()); // Successfully completed, no data to send back } // Otherwise it's NotFound return(NotFound()); }
public ActionResult Delete(AdventureTime_Story story) { storyRepo.DeleteStory(story); return(View("List")); }