Method with Dictionary Parameter in Asp.Net Web API

Viewed 26770

I need to make a GET request to a method that contains Dictionary as a parameter. I browse through but could not find any kinds of information about how I could send Dictionary so my request hit to my method. Method signature is as like as below

public void AddItems(Dictionary<string,object> Items)

Best Regards,

Kemal

4 Answers

If you have problems receiving Dictionary in your webApi controller, relatively painless solution is to switch the parameter to List<"ObjectRepresentingDict"> insetead. It will map automatically.

Related