Open JosiCoder opened 7 years ago
I have a change proposal for public static object EvalExpression (Expression expr)
public static object EvalExpression (Expression expr)
Instead of:
return lambda.Compile ().DynamicInvoke ();
you could do this:
var deleg = lambda.Compile (); try { return deleg.DynamicInvoke (); } catch (Exception ex) { return null; }
This prevents the application from crashing whenever the expressen called via DynamicInvoke throws an exception. Any contraindication?
I have a change proposal for
public static object EvalExpression (Expression expr)
Instead of:
you could do this:
This prevents the application from crashing whenever the expressen called via DynamicInvoke throws an exception. Any contraindication?