Click here to Skip to main content
15,891,184 members
Articles / Web Development / ASP.NET
Tip/Trick

Entity Framework 4 twist in Complex Type and stored procedure

Rate me:
Please Sign up or sign in to vote.
4.60/5 (5 votes)
23 Aug 2010CPOL 16.1K   5  
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)


Written By
Architect MindTree Ltd
India India
Motivated achiever who guides organizations in applying technology to business settings, provides added value, and creates project deliverables in a timely manner. An experienced Technical Consultant, have successfully led large project teams of more than 20 people from requirements gathering to implementation and support using C#, .NET ,ADO.NET, ADO.NET Entity Framework,ASP.NET,ASP.NET MVC, WCF and SQL Server.

Comments and Discussions

 
-- There are no messages in this forum --