Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="/DeleteItem/@item.Id" method="post">
- <td><input type="submit" name="submit" value="Delete"/></td>
- </form>
- [HttpPost]
- [Route("deleteItem/{id}")]
- public IActionResult DeleteItem(int id)
- {
- var temp = _context.Auction.Where(x => x.Id == id).SingleOrDefault();
- _context.Auction.Remove(temp);
- _context.SaveChanges();
- return RedirectToAction("Current", "Home");
- }
- var productToRemove = _context.Auction.SingleOrDefault(x => x.Id == id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement