Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / ASP.NET

Entity Framework 4 twist in Complex Type and stored procedure

4.60/5 (5 votes)
23 Aug 2010CPOL 16.2K  
Entity Framework 4 twist in Complex Type
Hi,

I was exploring a bit on new features of EF4. especially from the aspect of Complex types and storedprocedure.

A case where you need to be very careful is as follows:

A storedprocedure returns the result set which exactly matches Entity Object of EDM(Entity Data Model).From the wizard if you choose the return type as Entity and map to the respective Entity Object from the drop down of the wizard everything works fine, but the twist is that - if in the EDM if you create a complex type on the Entity Object, and then if you map this(Entity Object with Complex type property) to the return type of stored procedure - You will get the Invalid Operation Exception.

Hence the suggestion is that - you create the new complex type to work around

I hope this will be fixed with the next patch /release...


I hope this heps!.

Regards,
-Vinayak

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)