Skip to content

Commit

Permalink
[fix] 目标属性不可写入时,即使实现了IModel接口也不要赋值,否则其内部最终条用this.SetValue扩展,反射设置属性时仍然…
Browse files Browse the repository at this point in the history
…会报错。
  • Loading branch information
nnhy committed Jan 3, 2024
1 parent fcb7717 commit b52428f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions NewLife.Core/Reflection/IReflect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ public virtual void Copy(Object target, Object source, Boolean deep = false, par
var pis = sourceType.GetProperties(true);
foreach (var pi in targetType.GetProperties(true))
{
if (!pi.CanWrite) continue;
if (excludes != null && excludes.Contains(pi.Name)) continue;

var pi2 = pis.FirstOrDefault(e => e.Name == pi.Name);
Expand Down

0 comments on commit b52428f

Please sign in to comment.