Exemple #1
0
        /// <summary>
        /// 根据过滤条件Sql和参数(参数名和参数值)删除数据
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="whereSql">过滤条件Sql</param>
        /// <param name="whereParam">过滤条件参数(参数名和参数值),例:new {Uname="joyet",Age = 110}</param>
        /// <returns></returns>
        public virtual int Delete <T>(string whereSql, object whereParam)
        {
            int result   = 0;
            var dbEntity = DbBuilder.Delete <T>(whereSql, whereParam);

            if (dbEntity == null)
            {
                return(result);
            }
            result = DbHelper.ExecuteNonQuery(dbEntity.CommandText, dbEntity.DbParams);
            HandelExecuteDbCallBack(dbEntity.CommandText, dbEntity.DbParams);
            return(result);
        }