示例#1
0
        public static List <Maskapai> GetMaskapai()
        {
            List <Maskapai> MaskapaiList = new List <Maskapai>();

            try
            {
                using (var dc = new PinereDataContext(PinereConstant.PinereConnectionString))
                {
                    MaskapaiList = (from a in dc.GetMaskapai()
                                    select new Maskapai
                    {
                        Id = a.ID.ToString(),
                        Name = a.Maskapai,
                        Country = a.Negara
                    }).ToList();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
            return(MaskapaiList);
        }