Skip to content

Instantly share code, notes, and snippets.

@SlyNet
Created July 3, 2013 16:03
Show Gist options
  • Save SlyNet/5919806 to your computer and use it in GitHub Desktop.
Save SlyNet/5919806 to your computer and use it in GitHub Desktop.
right way to deserialize in .net. Json.net lib is used
public static T Deserialize<T>(this XDocument xDocument)
{
string serializeXNode = JsonConvert.SerializeXNode(xDocument.Root);
return JsonConvert.DeserializeObject<T>(serializeXNode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment