Reputation: 969
In a WCF class (with [DataContract]
attribute) I have this field:
[DataMember]
public List<string> XYZ;
But when I add a reference to the url of this service, in the Reference.cs file this field becomes
private string[] XYZ;
There must be, as usual, a very subtle reason for this, and I really would like to understand it!
Upvotes: 1
Views: 545
Reputation: 453
In your case, you need to select collection type as System.Collections.Generic.List and Dictionary collection type as System.Collections.Generic.Dictionary
Upvotes: 0
Reputation: 16878
There is an option for it in Visual Studio. While you are adding new service reference, click Advanced... button in Add Service Reference dialog and select how do you want to represent collection types:
Upvotes: 1