for each field in object c# code example
Example: for each property in object c#
foreach (PropertyInfo propertyInfo in obj.GetType().GetProperties())
{
// do stuff here
}
foreach (PropertyInfo propertyInfo in obj.GetType().GetProperties())
{
// do stuff here
}