Esempio n. 1
0
        public IActionResult Delete(string id)
        {
            var vehiculo = _vehiculoService.GetVehiculo(id);
            var soli     = _solicitudService.GetV(vehiculo.placa);

            if (vehiculo == null)
            {
                return(NotFound());
            }
            _vehiculoService.Remove(vehiculo.Id);
            if (soli != null)
            {
                _solicitudService.Remove(soli.Id);
            }
            return(Ok());
        }
Esempio n. 2
0
        public IActionResult Delete(string id)
        {
            var vehiculo = _vehiculoService.GetVehiculo(id);
            var soli     = _solicitudService.GetV(vehiculo.placa);

            if (vehiculo == null)
            {
                return(NotFound());
            }
            var filter = Builders <BsonDocument> .Filter.Eq("id", id);

            _vehiculoService.Remove(vehiculo.Id);
            if (soli != null)
            {
                _solicitudService.Remove(soli.Id);
            }
            return(Ok());
        }
Esempio n. 3
0
        public IActionResult Delete(string id)
        {
            var cliente = _clienteService.Get(id);

            if (cliente == null)
            {
                return(NotFound());
            }
            List <Vehiculo> lista = _vehiculoService.GetByCliente(cliente.Id);

            _clienteService.Remove(cliente.Id);
            if (lista != null)
            {
                for (int i = 0; i < lista.Count; i++)
                {
                    _vehiculoService.Remove(lista.ElementAt(i).Id);
                }
            }
            return(NoContent());
        }