using System.Collections.Generic;
using System.Linq.Expressions;
public int myProperty {get; set;}
public static void Main(string[] args)
TestClass obj = new TestClass();
Console.WriteLine("****************** C# Equivalent Output **************************\n\n");
Console.WriteLine(obj.myProperty);
Console.WriteLine("\n\n***************** Expression Tree Output **************************\n\n");
Expression propertyExpr = Expression.Property(
Expression.Constant(obj),
Console.WriteLine(Expression.Lambda<Func<int>>(propertyExpr).Compile()());