Equivalent of dd function of Laravel in Asp.Net C#

Viewed 2260

I want to migrate my code from Laravel PHP to ASP.Net Framework 4.6.1 C#.

In Laravel I can use function dd('test') or dd($variabel). Which is useful in-order to dump any variable's values with its data-type.

How can i achieve this same thing in ASP.NET?

2 Answers

The best way to debug your code (in C# / ASP.NET), and get all the info you need (like in dd()), is by using breakpoints within Visual Studio.

You can easily set a 'break' (multiple times) at any point of your application. This allows you to step through your application.

Each time a break is hit, the application pauses at that point. Whenever you click the 'continue' button, the application will resume.

Example from the documentation: Example from the Microsoft docs

You just have to play with this a bit to get the hang of it. But once you know how this toy works, you can't work without it ;-)

This code can help you

Console.WriteLine(variabel); 
break;
Related