I have something like this:
public class Foo
{
public Bar[] Bars{get; set;}
}
public class Bar
{
public string Name{ get; set; }
}
I start reflecting:
PropertyInfo propertyInfo = typeof(Foo).GetProperty("Bars");
so far so good. I want to reflect deeper:
Type type = _propertyInfo .PropertyType; // this gives me that the type is Bar[]
The type
is Bar[]
, but it is not possible to reflect on type
to look for property Name
.
Is there a way to figure out the trype without the array? Or another way to find the single type of Bar?