public IActionResult Delete(int id) { using (var __dbContex = new DbContext()) { Vehiculo target = new Vehiculo(__dbContex).Load(id); if (target.Id == 0) { return(NotFound()); } else { target.Delete(); return(Ok()); } } }