开发者

Imported a sproc in EF4 but no code was generated

I have a stored proc in my database and I am using Entity Framework 4 to work with the database from my code. Following instructions for importing a sproc, I was able to add it to my model and import a func开发者_运维问答tion to reference it. In the model browser under Function Imports, the stored proc and all its parameters appears. The access says "Public." Yet, I am not able to see it in Intellisense when I go to call it in my context object. When I do a global search on the name of the sproc, I see it appears in 3 places in the EDMX, and once in my calling code, but no code appears to have been generated for it in the Designer.cs file.

I must have missed a step or something, but as I look back through it, it's all pretty simple; I can't see where I went wrong. Has this happened to anyone? How can I troubleshoot?


if you switch to the model browser view on the .edmx file, you can see your imported SProcs under the model store node in the stored procedures folder. You can right-click them there and select "add function import" to generate the execution code in the entity data model's Designer.cs file. Unfortunately, you seem to have to do this import for them individually. If someone knows how to import them all simultaneously, I'd love to know.

Is that what you're looking for?


Take a look at this MSDN thread. On this forum, there is another thread addressing this issue in some way.
In short, it is an EF Designer limitation. You can try writing your own code to call this function, or use third-party designer like Entity Developer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜