Created
May 16, 2013 08:39
-
-
Save kadmil/5590298 to your computer and use it in GitHub Desktop.
Gist showing serialization issue.
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
[Route("/tmp")] | |
public class Tmp:IReturn<TmpResponse> | |
{ | |
public string Param { get; set; } | |
} | |
public class TmpResponse | |
{ | |
public Dictionary<KeyClass, List<ResponseData>> ResponseOptions { get; set; } | |
} | |
public class KeyClass | |
{ | |
public string FirstString { get; set; } | |
public string SecondString { get; set; } | |
} | |
public class ResponseData | |
{ | |
public string FirstProperty { get; set; } | |
public int SecondProperty { get; set; } | |
} | |
public class TmpService : Service | |
{ | |
public object Get(Tmp request) | |
{ | |
//return on client: | |
// {"{\"FirstString\":"first",\"SecondString\":"second"}":[{"FirstProperty":"first","SecondProperty":1}]} | |
//which is not deserializable to object due to quotes | |
return new Dictionary<KeyClass, List<ResponseData>> | |
{ | |
{ | |
new KeyClass() {FirstString = "first", SecondString = "second"}, | |
new List<ResponseData>() {new ResponseData() {FirstProperty = "first", SecondProperty = 1}} | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment