Suppose this expression:
Expression<Func<DateTime, dynamic>> exp = dt => new { dt.Second, dt.Hour, dt.Date.Day };
I need to obtain the following: "Second", "Hour", "Date.Day"
The best I've been able to accomplish is the following:
var body = exp.Body as NewExpression;
foreach(var member in body.Members)
member.Name().Dump();
But I only get: "Second", "Hour", "Day"
This is somewhat similar to this question but I'm dealing with a NewExpression here.
Aucun commentaire:
Enregistrer un commentaire