public Connections getConnection(City s, City d) { MSGDBContext db = new MSGDBContext(); Connections con = new Connections(); IEnumerable <Connections> q = db.Connections.Where(c => c.SourceCity.CityId == s.CityId && c.DestCity.CityId == d.CityId); foreach (Connections c in q) { con = c; } return(con); }
public City getCitybyName(string name) { MSGDBContext db = new MSGDBContext(); City city = new City(); IEnumerable <City> q = db.Cities.Where(s => s.CityName == name); foreach (City c in q) { city = c; } return(city); }