how to print all the object in c# code example
Example 1: .net c# print object
Console.WriteLine(JsonConvert.SerializeObject(OBJECTNAME, Formatting.Indented));
Example 2: c# print all property values of object
public static string PropertyList(this object obj)
{
var props = obj.GetType().GetProperties();
var sb = new StringBuilder();
foreach (var p in props)
{
sb.AppendLine(p.Name + ": " + p.GetValue(obj, null));
}
return sb.ToString();
}