public async Task <IActionResult> DeleteAuction([FromBody] tblAuctions auction) { var auct = await _context.TblAuction.FindAsync(auction.auctionId); if (auct == null) { return(NotFound()); } _context.TblAuction.Remove(auct); await _context.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> EditAuction([FromBody] tblAuctions auction) { _context.Entry(auction).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AuctionExists(auction.auctionId)) { return(NotFound()); } else { throw; } } return(NoContent()); }