This is a cursory question I can’t quite answer.
The main program
class Program{ static void Main(string[] args){ Console.WriteLine('Begin'); var myClass = new MyClass(); Util.Print(myClass.Id); Util.Print(myClass.Server); Util.Print(myClass.Ping); Console.WriteLine('End'); } }
How do I implement the Util.Print method to get this output to the console:
Begin Id Server Ping End
Assuming you don’t want to use strings, the most common answer is via an
Expression– essentially emulating the missinginfoof; you would have to use something like:Assuming they are all properties/fields (edit added method-call support):