public static Contracts.DataObjects.Airline GetAirline(string twoDigitCode)
        {
            Contracts.DataObjects.Airline result = new Contracts.DataObjects.Airline();
            using (var db = new DAL.FlightsEntities())
            {
                var airline = db.Airlines.Where(t => t.TwoDigitCode == twoDigitCode).FirstOrDefault();

                return(Contracts.CopyContract.CopyAirline(airline));
            }
        }
Example #2
0
        public static DataObjects.Airline CopyAirline(DAL.Airline obj)
        {
            DataObjects.Airline result = null;

            if (obj != null)
            {
                result = new DataObjects.Airline()
                {
                    ID             = obj.ID,
                    Name           = obj.Name,
                    TwoDigitCode   = obj.TwoDigitCode,
                    ThreeDigitCode = obj.ThreeDigitCode,
                    Country        = obj.Country
                };
            }

            return(result);
        }