Getting Invalid cast exception with MVC 4 API

33 views
Skip to first unread message

Mech0z

unread,
May 27, 2012, 5:34:45 PM5/27/12
to RestSharp
I am trying to retrieve an Int (Have tried creating a custom type T on
both client and server that it could databind to instead of just using
an int but that didnt work either)

With this code I get a first chance exception invalidcastexception in
restsharp.windowsphone

http://pastebin.com/HAKSzBZe

So the exception is caught in the Restharp lib, but I cant really
figure out why it fails at casting the int 1

I have this code that works fine that returns a List<T> http://pastebin.com/GMBX4G7Y

So I cant really see what difference I made other than the way I post
my variables, but they appear fine on the server side when I debug it

Mech0z

unread,
May 28, 2012, 4:21:31 PM5/28/12
to rest...@googlegroups.com
For some reason I cant use Int, if I create a custom type 
    
public class CreateUserResponse
    {
        public int ErrorCode { get; set; }
    }

it works fine
Reply all
Reply to author
Forward
0 new messages