Пример #1
0
        public void ImportGeoList()
        {
            IList <ELongGeoAdapter> Geos = ELongStaticClient.GetGeoList();

            this.OpenSession();
            ITransaction tx = this.session.BeginTransaction();

            foreach (ELongGeoAdapter geo in Geos)
            {
                GeoModel temp = new GeoModel();
                temp.from(geo);
                System.Console.WriteLine(string.Format("{0}:{1}:{2}:{3}", temp.id, temp.provinceName, temp.cityName, temp.url));
                this.session.SaveOrUpdate(temp);
            }
            tx.Commit();
        }