Beispiel #1
0
        public IHttpActionResult DeleteVehicle(long id)
        {
            Vehicle vehicle;

            try
            {
                vehicle = vehiclesService.Delete(id);
            }
            catch (Exception)
            {
                return(NotFound());
            }
            return(Ok(vehicle));
        }
Beispiel #2
0
        public IActionResult DeleteVehicle(int id)
        {
            var vehicle = _vehicles.GetById(id);

            if (vehicle == null)
            {
                return(NotFound());
            }

            _vehicles.Delete(vehicle);
            _vehicles.Save();

            return(Ok(id));
        }
Beispiel #3
0
        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());
            }
        }
Beispiel #4
0
 public IActionResult Delete(decimal VRId, IFormCollection formCollection)
 {
     _vehicleService.Delete(VRId);
     return(RedirectToAction("Index"));
 }