Skip to content

Instantly share code, notes, and snippets.

@imranbaloch
Created August 6, 2015 17:41
Show Gist options
  • Save imranbaloch/19ef360b5e45603860ba to your computer and use it in GitHub Desktop.
Save imranbaloch/19ef360b5e45603860ba to your computer and use it in GitHub Desktop.
Simple Mapper
public static class Mapper
{
public static T2 Map<T1, T2>(T1 t1)
{
var json = JsonConvert.SerializeObject(t1);
return JsonConvert.DeserializeObject<T2>(json);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment