Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

目前框架不支持使用字典进行动态更新,希望支持 #54

Closed
hymsnow opened this issue Feb 5, 2024 · 0 comments
Closed

Comments

@hymsnow
Copy link

hymsnow commented Feb 5, 2024

目前框架不支持使用字典进行动态更新,例如下面这样写,会报错:
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add("Id", user.Id);
dic.Add("ModifiedTime", DateTime.Now);
await _userRepository.Orm.UpdateDict(dic).AsTable("app_user").WherePrimary("Id").ExecuteAffrowsAsync();

报错的原因是在DbHelper文件的 AuditValue 【路径是:\src\platform.ZhonTai.Admin\Core\Db\DbHelper.cs】方法里面,e.Property 等于null

目前我是这样解决的

/// <summary>
/// 审计数据
/// </summary>
/// <param name="e"></param>
/// <param name="timeOffset"></param>
/// <param name="user"></param>
public static void AuditValue(AuditValueEventArgs e, TimeSpan timeOffset, IUser user)
{
    //处理使用字典更新时候,Property是空报错问题
    if (e.Property == null)
    {
        return;
    }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants