Created
August 6, 2015 17:41
-
-
Save imranbaloch/19ef360b5e45603860ba to your computer and use it in GitHub Desktop.
Simple Mapper
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 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