Reputation: 1535
I have a class used in RIA Services with a property of type
List<int>
This is being exposed as
IEnumerable<int>
Any reason why this can't be exposed by RIA as IList or just List?
IEnumerable is not the intended interface to be exposed. Worse yet, the type coming back is an array int[] which when I convert to IList on the client it is of Fixed Size and therefore cannot be added to.
Any suggestions?
Upvotes: 1
Views: 254
Reputation: 3356
A guess on why everything is exposed as IEnumerable instead of plain lists or arrays is because of the extended functionalities IEnumerable has.
It is very easy to convert IEnumerable to all other types of lists - arrays. Just add the System.Linq namespace and use .ToList() or .ToArray() extenions on any IEnumerable instance.
Upvotes: 0
Reputation:
Please post a copy of your property declaration, or the entire object declaration for the object you are working with. Also I would suggest you use an IList rather than List because it is more flexible and may give you a better reusability in the future.
Upvotes: 1