Top "Propertyinfo" questions

Ignore collection properties in PropertyInfo

I have a function with this code: foreach (PropertyInfo propertyInfo in typeof(T).GetProperties()){ //SOME CODE if (propertyInfo.CanWrite) propertyInfo.…

c# properties propertyinfo
How to get the default value of an object property?

Some code: foreach (System.Reflection.PropertyInfo pi in myObject.GetType().GetProperties()) { if (pi.CanWrite) { object value = pi.GetValue(Properties, null); // …

c# default propertyinfo