If you want to ignore the write-only properties, you could include the check for getter in the loop statement:
By the way, note that I used "csharp" as the option for the HIGHLIGHT tag to get syntax-highlighting appropriate to C#.csharp Code:
PropertyInfo[] properties = type.GetProperties(); foreach (PropertyInfo property in properties.Where(pi => pi.GetMethod() != null))




Reply With Quote
