diff --git a/src/CommonFramework/ExpressionExtensions.cs b/src/CommonFramework/ExpressionExtensions.cs index 30f30c2..41b6b85 100644 --- a/src/CommonFramework/ExpressionExtensions.cs +++ b/src/CommonFramework/ExpressionExtensions.cs @@ -26,7 +26,24 @@ public static Expression> UnCurrying> ToSetLambdaExpression() { return path.GetProperty().ToSetLambdaExpression(); - } + } + + public Func ToGetFunc() + { + return path.GetProperty().GetGetValueFunc(); + } + + public Action ToSetAction() + { + return path.GetProperty().GetSetValueAction(); + } + + public Action ToLazySetAction() + { + Lazy> lazySet = new(path.ToSetAction); + + return (source, value) => lazySet.Value(source, value); + } public Expression> OverrideInput(Expression> expr1) { diff --git a/src/CommonFramework/PropertyAccessors.cs b/src/CommonFramework/PropertyAccessors.cs index 0624a46..741296d 100644 --- a/src/CommonFramework/PropertyAccessors.cs +++ b/src/CommonFramework/PropertyAccessors.cs @@ -11,7 +11,7 @@ public record PropertyAccessors( { public PropertyAccessors( Expression> path) - : this(path, path.Compile(), path.ToSetLambdaExpression().Compile()) + : this(path, path.ToGetFunc(), path.ToLazySetAction()) { } diff --git a/src/__SolutionItems/CommonAssemblyInfo.cs b/src/__SolutionItems/CommonAssemblyInfo.cs index 9674d4b..7136d1d 100644 --- a/src/__SolutionItems/CommonAssemblyInfo.cs +++ b/src/__SolutionItems/CommonAssemblyInfo.cs @@ -3,7 +3,7 @@ [assembly: AssemblyProduct("CommonFramework")] [assembly: AssemblyCompany("IvAt")] -[assembly: AssemblyVersion("2.1.13.0")] +[assembly: AssemblyVersion("2.1.14.0")] [assembly: AssemblyInformationalVersion("changes at build")] #if DEBUG