Exemplo n.º 1
0
        public IHttpActionResult DeleteVehicle(long id)
        {
            Vehicle vehicle;

            try
            {
                vehicle = vehiclesService.Delete(id);
            }
            catch (Exception)
            {
                return(NotFound());
            }
            return(Ok(vehicle));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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());
            }
        }
Exemplo n.º 4
0
 public IActionResult Delete(decimal VRId, IFormCollection formCollection)
 {
     _vehicleService.Delete(VRId);
     return(RedirectToAction("Index"));
 }