Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

UpdateRange方法的并发异常处理似乎有问题 #312

Open
z094 opened this issue Apr 8, 2023 · 0 comments
Open

UpdateRange方法的并发异常处理似乎有问题 #312

z094 opened this issue Apr 8, 2023 · 0 comments

Comments

@z094
Copy link

z094 commented Apr 8, 2023

代码位置:/.Net6版本/VOL.Core/BaseProvider/RepositoryBase.cs : 374
描述:内层的foreach似乎没有对值进行任何修改,foreach内部的两个变量不知有何作用,也看不出对变量'databaseValues'的任何修改

foreach (var entry in ex.Entries)
{
    var proposedValues = entry.CurrentValues;

    var databaseValues = entry.GetDatabaseValues();
    //databaseValues == null说明数据已被删除
    if (databaseValues != null)
    {
        foreach (var property in properties == null
            || properties. Length == 0 ? proposedValues.Properties
            : proposedValues.Properties.Where(x => properties.Contains(x.Name)))
        {
            var proposedValue = proposedValues[property];
            var databaseValue = databaseValues[property];
        }
        affectedRows++;
        entry.OriginalValues.SetValues(databaseValues);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant