private void ClearDataBase() { foreach (Tunnel tunnel in Tunnel.GetTunnels()) { foreach (Cultivation cultivation in Cultivation.GetCultivationsInTunnel(tunnel.id)) { CultivationComment.DeleteFromBreeding(cultivation.id); Cultivation.DeleteFromTunnel(cultivation.id); } foreach (AvrDevice avr_device in AvrDevice.GetAvrDevicesInTunnel(tunnel.id)) { Measurement.DeleteMeasurements(); AvrDevice.DeleteAvrDevice(avr_device.id); } Tunnel.DeleteTunnel(tunnel.id); } Plant.DeletePlants(); }
public IActionResult Delete(int id) { Tunnel.DeleteTunnel(id); return(new NoContentResult()); }