public class TestClass
{
public string property1 { get; set; }
public string property2 { get; set; }
internal string property3 { get; set; }
internal string property4 { get; set; }
internal string property5 { get; set; }
}
Posso scorrere le proprietà con il seguente ciclo, ma mostra solo proprietà pubbliche. Ho bisogno di tutte le proprietà.come faccio a scorrere le proprietà interne in C#
foreach (PropertyInfo property in typeof(TestClass).GetProperties())
{
//do something
}
vedere anche http://stackoverflow.com/questions/16024006/how-do-i-look-up-the-internal-properties -di-ac-sharp-class-protected-protecte per una variante per questo. – nawfal