I have about 1000 classes in which i need to count the number of properties of. I have the following code:
public static int NumberOfProperties()
{
Type type = typeof(C507);
return type.GetProperties().Count();
}
I could copy and paste this in to each class changing the typeof
parameter but this seems a bit tedious, is there anyway to make an extensions method to do this by just doing var nop = C507.NumberOfProperties();
Aucun commentaire:
Enregistrer un commentaire