Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

loop over object properties c#

foreach (PropertyInfo prop in someObject.GetType().GetProperties())
{
    Console.WriteLine($"{prop.Name}: {prop.GetValue(someObject, null)}");
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #loop #object #properties
ADD COMMENT
Topic
Name
6+7 =