mercredi 23 décembre 2020

C# dynamically generate expression of property and empty argument

I need to create the following Lambda expression :

() => model.property

the model and its property will be determine at runtime. I want a function that takes the model and property and generate the expression:

public object GenerateLambda(object model, string property) 
{

}

If it is possible I don't want the function to be generic. but I think the main problem that I have is with () expression.





Aucun commentaire:

Enregistrer un commentaire