求教群主修改方法问题..急 返回

SqlSugar 老数据
2 3000

image.png

底层

public int Update(Expression<Func<TEntity, object>> update, Expression<Func<TEntity, object>> where)

        {

            try

            {

                var result = DbContext.Updateable<TEntity>().UpdateColumns(update).WhereColumns(where).ExecuteCommand();

                return result;

            }

            catch (Exception ex)

            {

                RollbackTran();

                throw new Exception(ex.Message);

            }


        }

报错

值不能为 null。\r\n参数名: source"


不能这么写吗?



改成这个也是一样

 DbContext.Updateable<TEntity>().UpdateColumns(update).Where(where).ExecuteCommand();

热忱回答(2)