I want to use var_dump to show the data held in a variable in C#, but I don't know the function to that in C#. If I use Console.Write(), I can only do it with a specific variable.
For example I want to vardump everything from data:
class Data {
int total_data = 21,
int total_page = 1,
int page = 1,
int limit = 21
}
var data = new Data();
Console.WriteLine(data.total_data);
How can I get something similar to PHP's var_dump in C#? I've tried using Console.WriteLine(data) but it doesn't work the same way. How can I do this?