Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Pass a Dictionary<object, object> as parameter to azure apicontroller method using invokeapiasync?

ChrisVardonChrisVardon GBMember ✭✭

I have an azure apicontroller method which I'm refactoring and I want to pass two objects to it rather than the one previously, so I decided to use a Dictionary<object1, object2> even though there is only ever going to be a single pair. Upon calling InvokeApiAsync() on the client, the method is successfully hit, however there parameter doesn't hold anything and there are no key/values in there.

The dictionary has objects with data before the invokeapiasync(), so I must be missing something fundamental here!? See Code below:

var ResultJSON = await Manager.DefaultManager.CurrentClient.InvokeApiAsync<Dictionary<Object1, Object2>, Newtonsoft.Json.Linq.JObject>(@"account/Method1", MyDictionary);

public async Task<Newtonsoft.Json.Linq.JObject> Method1(<Dictionary<Object1, Object2> myParameter)

Sign In or Register to comment.