Imagine that I have a dynamic variable:
dynamic d = *something*
Now, I create properties for d
which I have on the other hand from a string array:
string[] strarray = { 'property1','property2',..... }
I don't know the property names in advance.
How in code, once d
is created and strarray is pulled from DB, can I get the values?
I want to get d.property1 , d.property2
.
I see that the object has a _dictionary
internal dictionary that contains the keys and the values, how do I retrieve them?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…