Created
October 27, 2017 08:05
-
-
Save ps-team/4d511833fe49b0a4b707176221dda626 to your computer and use it in GitHub Desktop.
Convert an object into json to view its contents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
var obj = something; | |
@AsJson(obj); | |
} | |
@functions{ | |
string AsJson(object obj) { | |
return Newtonsoft.Json.JsonConvert.SerializeObject(obj); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment