简体   繁体   中英

Cannot materialize complex or primitive type - WCF Data services

i use WCF Data services along with Entity framework to talk to the SQL Server database. The data is not directly accessed through the ORM but instead ,the stored procedures are used to fetch and insert data.

I do a function import on the Entity framework and invoke them through the Web get calls from the WCF Dataservice.Most of the times these procedures return collection of Complex types (generated from EF).

This is how i execute from my asp.net mvc app

Context.Execute<T>("<service uri>", "GET",true);

Here is the error i get everytime

Cannot materialize a collection of a primitives or complex without the type being a collection.

Does the latest WCF Data services client does not support collection of complex types.

I am using the latest version of WCF Data services client which is 5.5

I had the same problem as yours and it solved when I changed the third parameter of Execute method (is single value) to false.

Hope this helps you.

Kamen Velikov

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM