using dictionary in a JsonRpcMethod argument.

33 views
Skip to first unread message

JeffJ

unread,
Feb 20, 2012, 10:46:37 PM2/20/12
to Jayrock
I'd like to use a dictionary in a JsonRpcMethod argument.

For this...
public Dictionary<String, String> ShowDct(Dictionary<String, String>
dct,int num)

Json...
{"id":"1","method":"dctCall","params":
[{"Height":"100","Width":"120","Top":"5","Left":"11"},99]}

As I break point at the call, I get the dct created (of the correct
type), but it has no entries, the num (99) is coming through as it
should.

Do I have to invent something here (a convention of sort, with a touch
to the jayrock code). I saw the attribute for a WarpedParameter,
could you explain what that is used for.

thanks,
jeff

Atif Aziz

unread,
Feb 21, 2012, 8:01:54 AM2/21/12
to jay...@googlegroups.com
Try with changing your method signature to take and return IDictionary<string, string> as opposed to  Dictionary<string, string>, as follows:

public IDictionary<String, String> ShowDct(IDictionary<String, String>
dct,int num)

- Atif


--
You received this message because you are subscribed to the Google Groups "Jayrock" group.
To post to this group, send email to jay...@googlegroups.com.
To unsubscribe from this group, send email to jayrock+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jayrock?hl=en.


JeffJ

unread,
Feb 21, 2012, 3:32:30 PM2/21/12
to Jayrock
Works nicely. thank you.
Reply all
Reply to author
Forward
0 new messages