Printnig Pretty JSON With C#

preview_player
Показать описание
Working with JSON in C# is easy! However, JSON strings are usually hard to read. Can we do something about this? Of course we can! Here's how to print pretty JSON in C#.
#shorts #dotnet #csharp #programming #programmingtips

Join this channel to get source code access and other perks:

Also follow me here (especially if you are a self taught developer):

My setup:
Рекомендации по теме
Комментарии
Автор

This is how yoolu get a developer to jump quickly into the comments to scream

T___Brown
Автор

this is horrible for so many reasons... First don't return json from ToString... But besides that if you're going to do it, put your JsonOptions in a static variable, there's no reason to create a new json options every time you call ToString

ronsijm
Автор

Is it common to use json in the toString method?

CG-ycnj
Автор

Recommend highly not to do this, as tostring can be invoked in a number of unexpected scenarios, not just that, the performance will be terrible in hot paths

srivathsaharishvenk
Автор

So simple I can't believe I never thought of this before

henry-js