コード例 #1
0
        public static List <Сarriage> GetAllCarriages()
        {
            var rez = new List <Сarriage>();

            using (var db = new CarriageContext())
            {
                rez = db.Сarriages.Include("FactualCarriage").ToList();
            }

            return(rez);
        }
コード例 #2
0
        public static List <CarriageCount> GetCarrCountByCarrId(int carrId)
        {
            var rez = new List <CarriageCount>();

            using (var db = new CarriageContext())
            {
                rez = db.СarriageCount.Where(c => c.CarriageId == carrId).ToList();
            }

            return(rez);
        }
コード例 #3
0
        public static List <Сarriage> GetCarriagesBySendingAndArrivalCityId(int sendingCityId, int arrivalCityId)
        {
            var rez = new List <Сarriage>();

            using (var db = new CarriageContext())
            {
                rez = db.Сarriages.Include("FactualCarriage").Where(c => c.ArrivalCityId == arrivalCityId).Where(c => c.SendingCityId == sendingCityId).ToList();
            }

            return(rez);
        }