开发者

function import in entity framework

开发者 https://www.devze.com 2023-03-29 16:39 出处:网络
As the MSDN says Do one of the following from the Model Browser: Open the Stored Procedures folder (in the stor开发者_StackOverflow中文版age model information) and double-click a stored procedure th

As the MSDN says

    Do one of the following from the Model Browser:

    Open the Stored Procedures folder (in the stor开发者_StackOverflow中文版age model information) and double-click a stored procedure that does not have a corresponding function import.

- OR -

    Right-click the Function Imports folder (in the EntityContainer node of the conceptual model information) and then select Add Function Import.

The Add Function Import dialog box appears.

How can I do function import if my db contains hundreds of sps. Should I go to each sp and do the steps above :( .. It makes no sense.


I have a very large Entity Framework model and I use the Huagati DBML/EDMX tools. It was able to bulk add new tables, views and columns that were in the database but not in the EDMX. It saved a lot of manual work. I haven't used it for stored procedures but it looks like it supports it. Even better, they have a free trial so you can always give it a try to see if it will work for you.

Edit: It also sounds like they have made some improvements to this in the latest version of EF - the June 2011 CTP. This blog post states:

There are several new features for the Entity Framework Designer within Visual Studio:

  • [...]

  • When you import stored procedures using the Entity Model Wizard, you can now batch import your stored procedures as function imports. The result shape of each stored procedure will automatically become a new complex type in your entity model. This makes getting started with stored procedures very easy.

If you don't want to use a CTP, this blog post says they might have the official version out next month.

0

精彩评论

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

关注公众号