mercredi 28 février 2018

How to set local variable memberExpression value

I want to get parameter original name and update its value. How can I do this?

public void SetMember<T>(Expression<Func<T>> memberExpression)
{
    var body = (MemberExpression)memberExpression.Body;
    var name = body.Member.Name; //text

    //can I set variable value here 
}

static void Main(string[] args)
{
    var text="test";
    SetMembere(() => text);
}





Aucun commentaire:

Enregistrer un commentaire