开发者

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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜