Good day, I am making a list in C# in which I want Array()
another list to be generated with the attributes of Array()
using a for
. This is what I have, but I don't know how I can assign values to the dynamic property that has just been created.
string[] propiedades = { "foo","x"};
var prueba = new List<string>();
for(int x = 0;x <= propiedades;x++){
prueba.Add(propiedades[x]);
prueba.propiedades[x]="test";
}
I'm looking for something like this:
prueba.foo: "test"
prueba.x:"x"
I don't know if what I want to do is possible, thank you very much in advance
Greetings.