public IEnumerable <Plane> AddPlaneToCurrent(List <Plane> plane) { IEnumerable <Plane> currentListOfPlanes = new List <Plane>(); using (var db = new PlaneContext()) { currentListOfPlanes = db.Plane.AddRange(plane); } return(currentListOfPlanes); }
public IEnumerable <Plane> AddPlaneToHistory(List <Plane> plane) { IEnumerable <Plane> historyListOfPlanes = new List <Plane>(); using (var db = new PlaneContext()) { historyListOfPlanes = db.Plane.AddRange(plane); } return(historyListOfPlanes); }
public IEnumerable <Plane> AddPlaneToTakeOff(List <Plane> plane) { IEnumerable <Plane> listOfTakeOffPlanes = new List <Plane>(); if (plane != null) { using (var db = new PlaneContext()) { listOfTakeOffPlanes = db.Plane.AddRange(plane).Where(x => x.StatusFly == StatusFly.Fly); } return(listOfTakeOffPlanes); } else { return(null); } }
public PlaneRepository() { planeContext = new PlaneContext(); }