views:

811

answers:

1

Hi,

In LINQ2SQL it was possible to set the return type of a stored procedure to auto generated. I am unable to do so with the Entity Framework.

I want to set the return type of a stored procdure to auto-generated with the Entity Framework. Is this possible?

Kind regards.

+1  A: 

Entity Framework V1 has good support for working with Stored Procedures directly with entities (as Insert/Update/Delete operations) but as you have discovered, out of the box the support for SPs as functions on your ObjectContext is poor. They pretty much always have to map perfectly to an existing entity in your model as the expectation was you would then do changes to the returned results from the SP and hence would want to work with them as entities. Clearly this is not always the case.

Thankfully there are extensions for EF v1 which include improved support for SPs. Download the extensions here.

EF v2 will have better support.

Eric Nelson

related questions