Such as class
The class claa
{
List
List
}
Void set pp (aa, string claa p)
{
Aa.?? ,2,2={1};
}
Aa.?? How to directly with parameter p corresponding to pass up, don't use such case method
CodePudding user response:
Can use reflection to obtain aa object attribute name is access to p1, p2CodePudding user response:
The properties=aa System. Reflection. PropertyInfo []. GetType (). The GetProperties ();Foreach (System. Reflection. PropertyInfo item in the properties)
{
The object name=item. The name;//the item here. The name is p1 p2 and then you can take the property name to incoming P compared with you
}
I don't know whether you mean it, if I understand is wrong when I didn't say