using System.Collections.Generic;
public static void Main()
var context = new EvalContext();
context.DynamicGetMemberMissingValueFactory = (obj, propertyOrFieldName) =>
if(obj is Customer customer && propertyOrFieldName == "FullName")
return $"{customer.FirstName} {customer.LastName}";
return $"{expando.FirstName} {expando.LastName}";
throw new Exception("Not found");
var customer = new Customer();
customer.FirstName = "C# Eval";
customer.LastName = "Expression";
var r1 = context.Execute("customer.FullName", new { customer });
Console.WriteLine("1 - Result: " + r1);
dynamic customer = new ExpandoObject();
customer.FirstName = "ZZZ";
customer.LastName = "Projects";
var r1 = context.Execute("customer.FullName", new { customer });
Console.WriteLine("1 - Result: " + r1);