c# loop through object and give value to property code example
Example: loop over object properties c#
foreach (PropertyInfo prop in someObject.GetType().GetProperties())
{
Console.WriteLine($"{prop.Name}: {prop.GetValue(someObject, null)}");
}