Bogdan Ioan Gabor
Bogdan Ioan Gabor

Reputation: 419

Silverlight : alternatives for sending a List<T> as an argument for a WCF RIA DomainService method

I want to create a DomainService method that receives a List (where T: Entity) kind of an argument, but it seems this cannot be done in Silverlight (Error message : "operation ... does not conform to the required signature. Parameter types must be an entity or complex type, a collection of complex types, or one of the predefined serializable types.")

What are the alternatives? Thank you.

Upvotes: 1

Views: 444

Answers (2)

Rami A.
Rami A.

Reputation: 10582

Serialize the List<T> to a string in the client and then deserialize it on the server.

I did this with the DataContractSerializer and it works great.

WCF RIA Services Contrib also has the ability to Import and Export a collection of entities with added benefits.
http://riaservicescontrib.codeplex.com

Upvotes: 0

Fabian Vilers
Fabian Vilers

Reputation: 2982

Just pass a T[] array, it should fix it and it is more "proper" as there's no reason to add elements to the list.

Upvotes: 1

Related Questions