Let's say I have following expressions on a collection:
var people = new List<Person>
{
new Person {FullName = "Some Dude", Age = 45},
new Person {FullName = "Another Dude", Age = 28},
new Person {FullName = "Some Other Dude", Age = 36}
};
var filtered = people.Where(person => person.Age > 28 && person.FullName.StartsWith("So"));
var narrowlyFiltered = people.Where(person => person.Age > 36 && person.FullName.StartsWith("Some"));
Is there a way to compare these two expressions and deduce that second expression is subset of first one on runtime? Without enumerating or anything else. I just have expressions and I am trying to find out if these expressions intersect or contains one another.