Tuesday, December 21, 2010

Entity Framework 4 twist in Complex Type and stored procedure


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 aroundI hope this will be fixed with the next patch /release...

I hope this heps!.



No comments: