public IHttpActionResult DeleteVehicle(long id) { Vehicle vehicle; try { vehicle = vehiclesService.Delete(id); } catch (Exception) { return(NotFound()); } return(Ok(vehicle)); }
public IActionResult DeleteVehicle(int id) { var vehicle = _vehicles.GetById(id); if (vehicle == null) { return(NotFound()); } _vehicles.Delete(vehicle); _vehicles.Save(); return(Ok(id)); }
public IHttpActionResult Delete(string id) { Guid guid = new Guid(id); try { var found = _vehiclesService.Delete(guid); if (!found) { return(NotFound()); } return(Ok()); } catch (Exception) { return(InternalServerError()); } }
public IActionResult Delete(decimal VRId, IFormCollection formCollection) { _vehicleService.Delete(VRId); return(RedirectToAction("Index")); }