Please help to solve issue below:
public class TestParent
{
public int Number { get; set; }
}
public class Test
{
public TestParent Parent { get; set; }
}
class Program
{
static void Main(string[] args)
{
Expression<Func<TestParent, bool>> parentExpression = x => x.Number == 10;
Expression<Func<Test, TestParent>> testExpression = x => x.Parent;
var test = new Test {Parent = new TestParent {Number = 10}};
Expression<Func<Test, bool>> composedExpression = ?; // x => x.Parent.Number == 10
bool result = composedExpression.Compile()(test);
if (result)
{
Console.WriteLine("Test passed!");
}
}
}