public async Task <bool> Delete(string id) { Task <draw> dwTask = _context.draw.FirstOrDefaultAsync(p => p.DrawID == id); draw dw = dwTask.Result; if (dw == null) { return(false); } _context.Remove(dw); await _context.SaveChangesAsync(); return(true); }
public async Task <bool> Delete(string id) { Task <Ticket> tkTask = _context.ticket.FirstOrDefaultAsync(p => p.Ticket_id == id); Ticket tk = tkTask.Result; if (tk == null) { return(false); } _context.Remove(tk); await _context.SaveChangesAsync(); return(true); }