using EC.Helper.RabbitFunc.Expressions; using EC.Helper.RabbitFunc.Runtime; namespace EC.Helper.RabbitFunc.Extern; [ExternLambda] internal class AbsLambdaExpression : SystemLambdaExpression { public AbsLambdaExpression() : base(typeof(Math).GetMethod(nameof(Math.Abs), new Type[] { typeof(double) }), "abs", new BodyExpression(), Expression.Parameter(typeof(double), "x")) { } private class BodyExpression : Expression { public override object Eval(RuntimeContext context) { return Math.Abs(ParameterExpression.Access(context, "x")); } } }