Exemplo n.º 1
0
 public void QueryCityDataByExt()
 {
     try
     {
         GetCityDatas();
         ConfigurationItems cfg = new ConfigurationItems();
         DBReporistory <Domain.CommonData.CategoryData> cds = new DBReporistory <CategoryData>("TecentDASQLite");//提供配置的节点名,不能直接使用配置的连接串内容
         List <Domain.CommonData.CategoryData>          ds  = cds.DoQuery <Domain.CommonData.CategoryData>().ToList();
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 2
0
        public List <Domain.CommonData.CategoryData> QueryCityDataByExt()
        {
            List <Domain.CommonData.CategoryData> list = new List <CategoryData>();

            try
            {
                DBReporistory <Domain.CommonData.CategoryData> cds = new DBReporistory <CategoryData>("TecentDASQLite");
                list = cds.DoQuery <Domain.CommonData.CategoryData>().ToList();
                return(list);
            }
            catch (Exception ex)
            {
                return(list);
            }
        }
Exemplo n.º 3
0
 public static void SyncCategory(List <CategoryData> list)
 {
     try
     {
         DBReporistory <CategoryData> md    = new DBReporistory <CategoryData>(new ConfigurationItems().SqliteDbConnString);
         List <CategoryData>          dstas = md.DoQuery <CategoryData>().ToList();
         //一次操作数据量过大需要分批次
         List <CategoryData> group = new List <CategoryData>();
         for (int i = 0; i < list.Count; i++)
         {
             group.Add(list[i]);
             if (i % 2 == 0)
             {
                 md.AddList(group.ToArray());
                 group.Clear();
             }
         }
     }
     catch (Exception ex)
     {
     }
 }