Entity Framework with 'Get' Stored Procedure that returns Entities

Posted by Nick Reeve on Stack Overflow See other posts from Stack Overflow or by Nick Reeve
Published on 2010-05-04T12:24:52Z Indexed on 2010/05/04 12:28 UTC
Read the original article Hit count: 220

Hello,

I am attempting to execute a stored procedure that returns data with exactly the same columns as that of a table Entity I have in my project. I set the 'Returns a Collection Of' property in the 'Add Function Import' dialog to my entity type.

I get a NullReferenceException error when executing the stored procedure and on further digging it seems that it is because the 'EntityKey' property is missing. Is there anything I can do to tell it to ignore those special properties of the Entity?

I already have a partial class for that entity with '[ScaffoldColumn(false)]' but that doesn't seem to matter.

Cheers, Nick

© Stack Overflow or respective owner

Related posts about entity-framework-4

Related posts about stored-procedures