Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }