I generally override the ToString() method to output the property names and the values associated to them. I got a bit tired of writing these by hand so I\'m looking for a d
I would use JSON, Serializer will do all the hard work for you:
public static class ObjectExtensions { public static string ToStringEx(this object obj) { return JsonSerializer.Serialize(obj, new JsonSerializerOptions { WriteIndented = true }); } }