Subsonic 3 - Update NullReferenceException

江枫思渺然 提交于 2019-12-06 15:18:24

Hmm - I would say to make sure the connection string is present (I'll be fixing the error message for missing connection strings in the coming weeks) other than that - this looks like an issue - would you mind posting at Github?

Scott

I did a simple update which give me an NullReferenceException

FarmDB db = new FarmDB();
db.Update<UserInfo>().Set(x => x.phone == "13679178184").Where(x => x.name == "marship").Execute();

After step into the code, I found the line in Query/update.cs L186

internal Setting CreateSetting(IColumn column, bool isExpression)
{
    Setting s = new Setting
    {
        query = this,
        ColumnName = column.Name,
        ParameterName = (_provider.ParameterPrefix + "up_" + column.Name),
        IsExpression = isExpression,
        DataType = column.DataType
    };
    ...

The ColumnName = column.QualifiedName should be ColumnName = column.Name.

After correct this, update runs well. Hope some one can check this.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!