I'm trying to extract all public properties (whether they use get/set or not) of a class using reflection. However, I find that I can only retrieve the properties that use get/set following Get property value from string using reflection.
class ClassA
{
public string layout { get; set; }
public int capacity { get; set; }
public Link[] links;
public ClassA(int n)
{
capacity = n;
links = new Link[n];
for (int i = 0; i < n; i++)
{
links[i] = new Link();
}
}
}
take the above class as an example. I can only get layout
and capacity
through reflection. Is there any way I can get "links"?