I'm currently working towards creating dynamic expressions and I have the following scenario, which I'd like help to achieve.

given:

```
public class planet {
    public string name { get;set; }
}

class someTestClass {
    [Test]
    public void Planet_Exists_Statically(){
        var planetName = "earth";
        var planets = new List<planet> {new planet {name = planetName}};
        var found = planets.Exists(MakePredicate(planetName));
        Assert.IsTrue(found);
    }

    [Test]
    public void Planet_Exists_Statically(){
        var planetName = "earth";
        var planets = new List<planet> {new planet {name = planetName}};
        var found = planets.Exists(MakeDynamicPredicate(planetName));
        Assert.IsTrue(found);
    }

    private Predicate<planet> MakePredicate(string planetName){
        Expression<Predicate<planet>> pred = p => p.name == planetName;
        return pred.Compile();
    }

    private Predicate<planet> MakeDynamicPredicate(string planetName){
        var parm = Expression.Parameter(typeof(planet), "p")
        var pred = Expression.Lambda<Predicate<planet>>(
                    Expression.ReferenceEqual(
                        Expression.Property(parm, typeof(planet), "name"), 
                        **???WHAT GOES HERE???**,
                        parm);
        return pred.Compile();
    }
}

```

So my issue is that I can't get the predicate returned from the MakeDynamicPredicate to be equal to the one generated by the MakePredicate function. 

I read a [reply post from Jon Skeet](https://stackoverflow.com/a/7220792), but don't understand how to implement the ConstantExpression so that the local variable is captured...

Any help would be greatly appreciated.

Additional info: going forward I may not know the class that is being used so it will eventually be abstracted to be more generic.