Esempio n. 1
0
 /// <summary>
 /// 海量数据插入方法
 /// </summary>
 /// <typeparam name="db"></typeparam>
 /// <param name="list"></param>
 public virtual void AddByBulkCopy <T>(DbContext db, List <T> list) where T : class, new()
 {
     // 让使用typeof(T).Name标签的所有缓存过期
     QueryCacheManager.ExpireTag(typeof(T).Name);
     AddByBulkCopy((SqlConnection)db.Database.Connection, db.ToDataTable <T>(list), typeof(T).Name);
 }