Esempio n. 1
0
        /// <summary>
        /// 插入
        /// 使用说明:sqlSugar.Insert(entity);
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="entity">插入对象</param>
        /// <param name="isIdentity">主键是否为自增长,true可以不填,false必填</param>
        /// <returns></returns>
        public object Insert <T>(T entity, bool isIdentity = true) where T : class
        {
            var connName = CloudPubMethod.GetConnection(this.configList);
            var db       = new SqlSugarClient(connName);

            SettingConnection(db);
            return(db.Insert <T>(entity, isIdentity));
        }