Last active
February 14, 2022 22:41
-
-
Save RickStrahl/e3df0de7e9603205270c059e5de00dda to your computer and use it in GitHub Desktop.
CreateGistFile
This file contains 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
public static JObject CreateGistPostJson(GistItem gist) | |
{ | |
dynamic obj = new JObject(); | |
obj.Add("description", new JValue(gist.description)); | |
obj.Add("public", gist.isPublic); | |
obj.Add("files", new JObject()); | |
obj.files.Add(gist.filename, new JObject()); | |
var fileObj = obj.files[gist.filename]; | |
fileObj.content = gist.code; | |
// add a comment | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment