Reputation: 611
I'm Using C#.
I'm trying to create a web method in my .asmx file as follow:
[WebMethod]
public string MyWebMethod(Dictionary<string, string> parameters)
{
//...
}
And I got the following exception:
The type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] is not supported because it implements IDictionary.
How can i fix it?
Thanks.
Upvotes: 1
Views: 798
Reputation: 440
you can't use Dictionary
direct but you can use list
as parameters
and this link can help you to convert List
to Dictionary
and continue your flow
Upvotes: 1