Hi,
I have a list of pairs (CarType(Enum), code(string)). Unfortunately in this collection codes are not unique.
Van,C1
Van,C2
Pickup,C1
How to pass this collection via asmx webservice.
Now I have KeyValuePair[] as parametr in webMethod
[webmethod]
public void DestroyCars(KeyValuePair<string, CarType>[] cars)
{
//implementation.
}
But when I update my webreference(not servicereference) and put instance of KeyValuePair[] in
service.DestroyCars(someinstance of KeyValuePair<string, CarType>[])
I get exception, because I must there KeyPairValuOfStringCarType.
Why is that and how to fix it ?
To be more clear:
I want to pass multidimension collection through webservice.
I create
[webmethod] public void DestroyCars(KeyValuePair[] cars) { //implementation. }
I update webreference of my application.
When I want to call this webmethod from my application with new instance of KeyValuePair[] I get error that this parameter is not assignable to parameter type of my webmethod.
Intellisense tells me that type of this parameter is KeyPairValuOfStringCarType with is not a true.
I check type of this type in net.reflector and I see that is a string.
I know there is no sense. This is way I ask for help :/