I have an object that I want to be constructed in such manner:
var foo = new FancyObject(customer, c=>c.Email); //customer has Email property
How should I declare second parameter?
How the code that will access selected property setter/getter will look like?
Upd. There are several entities in the model that has Email property. So probably the signature will looks like:
public FancyObject(Entity holder, Expression<Func<T>> selector)
and the constructor call
var foo = new FancyObject(customer, ()=>customer.Email);