mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 20:38:16 +08:00
- 修复 DbContext/Repository Update 不更新 DbUpdateValue 的问题;#219
This commit is contained in:
@ -553,20 +553,31 @@ namespace FreeSql.Extensions.EntityUtil
|
||||
{
|
||||
if (_table.ColumnsByCs.TryGetValue(prop.Name, out var trycol) == false) continue;
|
||||
exps.Add(
|
||||
Expression.IfThenElse(
|
||||
Expression.Equal(
|
||||
Expression.MakeMemberAccess(var1Parm, prop),
|
||||
Expression.MakeMemberAccess(var2Parm, prop)
|
||||
),
|
||||
trycol.Attribute.CanUpdate == false ?
|
||||
Expression.IfThen(
|
||||
Expression.IsTrue(parm3),
|
||||
Expression.Call(var1Ret, typeof(List<string>).GetMethod("Add", new Type[] { typeof(string) }), Expression.Constant(trycol.Attribute.Name))
|
||||
),
|
||||
Expression.IfThen(
|
||||
Expression.IsFalse(parm3),
|
||||
Expression.Call(var1Ret, typeof(List<string>).GetMethod("Add", new Type[] { typeof(string) }), Expression.Constant(trycol.Attribute.Name))
|
||||
) : (
|
||||
trycol.Attribute.CanUpdate && string.IsNullOrEmpty(trycol.DbUpdateValue) == false ?
|
||||
Expression.IfThen(
|
||||
Expression.IsFalse(parm3),
|
||||
Expression.Call(var1Ret, typeof(List<string>).GetMethod("Add", new Type[] { typeof(string) }), Expression.Constant(trycol.Attribute.Name))
|
||||
) :
|
||||
Expression.IfThenElse(
|
||||
Expression.Equal(
|
||||
Expression.MakeMemberAccess(var1Parm, prop),
|
||||
Expression.MakeMemberAccess(var2Parm, prop)
|
||||
),
|
||||
Expression.IfThen(
|
||||
Expression.IsTrue(parm3),
|
||||
Expression.Call(var1Ret, typeof(List<string>).GetMethod("Add", new Type[] { typeof(string) }), Expression.Constant(trycol.Attribute.Name))
|
||||
),
|
||||
Expression.IfThen(
|
||||
Expression.IsFalse(parm3),
|
||||
Expression.Call(var1Ret, typeof(List<string>).GetMethod("Add", new Type[] { typeof(string) }), Expression.Constant(trycol.Attribute.Name))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
a++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user