If I have a WCF service which accepts an IEnumerable as a parameter to a function, is the order that I look up the elements guaranteed to be the same as they were added to the collection? (Or at least the same order they were sent across the wire?)
If not, is there a way that I can guarantee the order, such as defining it in the service contract as a List?
The serialiser will naturally serialise items in the order in which they are served up by the collection’s enumerator. For a
ListorArray, this will always be the order in which they are added, but for anything based on a hashtable, the order is not guaranteed. To guarantee the order, use an array-based collection.