public static List <Сarriage> GetAllCarriages() { var rez = new List <Сarriage>(); using (var db = new CarriageContext()) { rez = db.Сarriages.Include("FactualCarriage").ToList(); } return(rez); }
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); }
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); }