views:

552

answers:

2

Is it possible to map stored procédures whit EF 4 using T4 templates ? I have searched and I conclude that it is not possible yet.

It exist some methods like Edm.SourceComplexTypes(), Edm.SourceAssociations(), Edm.SourceEntities() but nothing about stored procedures ...

Someone have any answer ?

Thanks.

+2  A: 

I'm doing it. Just open your edmx, right click on the design surface and select Add > Function Import. You can map the results of the SP to an existing entity or to a new entity type.

After doing this, transform all the templates in the solution and you should be good to go.

Will
I tried it, but I haven't find a way to list the stored procedures in my template.
gtoulouse
@gtoul Not sure what your issue is. You can import a SP as a function by right-clicking on your EDMX's design surface. Once you've imported it the SP shows as a function of your data context.
Will
+1  A: 

I have the same issue. The mapping goes away when I add a T4 template lige Self-TRacking entities.

Furthermore I get an error if I try to add the mapping in the edmx to only the delete function. Cannot find the InsertFunctionMapping for EntityType 'myEntity' in the mapping file

I was under the impression the EF4 had relaxed the function mapping requirements? Does this not apply to using SelfTracking entities?

S10