public FlightSchedule Get(string id1) { FlightSchedule flights = null; try { var flightFound = db.FlightSchedules.Where(f => (f.FlightId == id1)).SingleOrDefault(); if (flightFound != null) { flights = flightFound; } else { flights = null; } } catch (Exception ex) { throw ex; } return(flights); }
public void Update(FlightSchedule fs) { db.Entry(fs).State = EntityState.Modified; db.SaveChanges(); }
public void Add(FlightSchedule newFlightSchedule) { db.FlightSchedules.Add(newFlightSchedule); db.SaveChanges(); }