Does the new TypeInfo class include private members by default in its "DeclaredXXX" properties?
It returns both private and public members. However only ones that are declared at that level, any inherited members etc. will not be returned.
If it is a Property and not a Field it will show private members in DeclaredProperties
public class Test
{
private string test; // will not be in DeclaredProperties
private string test2 { get; set; } // will be in DeclaredProperties
public int test3{ get; set; } // will be in DeclaredProperties
}
var result = typeof(Test).GetTypeInfo().DeclaredProperties;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With