Esempio n. 1
0
        /// <summary>
        /// 异步插入多条数据
        /// </summary>
        /// <param name="infoList">要插入的数据列表</param>
        /// <param name="keyName">主键名字</param>
        /// <param name="ignoreFields">要忽略的字段</param>
        /// <param name="isIdentity">是否自增</param>
        /// <returns></returns>
        public Task InsertManyAsync(List <T> infoList, string keyName = null, string[] ignoreFields = null, bool isIdentity = true)
        {
            SqlQuery query = SqlQueryUtil.BuilderInsertManySqlQuery(infoList, TableName, keyName: keyName, ignoreFields: ignoreFields, isIdentity: isIdentity, dbType: WriterDataType);

            return(GetDataAccess().ExecuteNonQueryAsync(query));
        }
        public void InsertMany(List <T> infoList, string keyName = null, string[] ignoreFields = null, bool isIdentity = true)
        {
            SqlQuery query = SqlQueryUtil.BuilderInsertManySqlQuery(infoList, TableName, keyName, ignoreFields, dbType: WriterDataType);

            GetDataAccess().ExecuteNonQuery(query);
        }