public void MoveToNextStation(Station station, Plane plane) { plane.CurrentStation = station; station.CurrentPlane = plane; Thread.Sleep(2000); Task.Run(() => notifyService.PlaneMoved(plane)); //db update!!!!!! if (station is HangarStation hangar)// in hangar { OnHangarArrival(plane, hangar); } else if (station is RunwayStation runway) // in runway { OnRunwayArrival(plane, runway); } else // in middle station { Station nextStation = GetNextStation(station); if (station != null) // there is station to move to { MoveToNextStation(nextStation, plane); station.CurrentPlane = null; } } }