Esempio n. 1
0
 public bool Add(Flight flight)
 {
     if (flight == null)
     {
         return(false);
     }
     Flights.Add(flight);
     SetAirplaneToFirstStation?.Invoke(flight);
     return(true);
 }
Esempio n. 2
0
        public async Task <bool> Add(Flight flight)
        {
            if (flight.AirplaneId == 0)
            {
                bool res = await AssignAirplane(flight);

                if (!res)
                {
                    return(false);
                }
            }
            var isSuccess = await repository.Add(flight);

            if (!isSuccess)
            {
                return(false);
            }
            Flights.Add(flight);
            SetAirplaneToFirstStation?.Invoke(flight);
            return(true);
        }