Stored Procedures and updating EDMX

前端 未结 5 1561
你的背包
你的背包 2020-12-22 15:37

I have had endless issues with stored procedures and EDMX. I created a procedure, updated the model from the database, and all worked. I then removed a column and added a ne

5条回答
  •  -上瘾入骨i
    2020-12-22 16:24

    (This solution is for EF 6. I have not tried in other EF versions. It works nice.)


    Go to Model browser. MyStoreProc is the name of the stored procedure (as an example). MyStoreProc will appear in 3 places.

    1. 1st place- Under Complex Types-> as MyStoreProc_result
    2. 2nd Place- Under Function Imports -> as MyStoreProc
    3. 3rd Place - Under Stored Procdures/ Functions -> as MyStoreProc

    Delete all three from model. Save the edmx (by clicking in the window then ctrl+S). Then right click and click update the model from database. Then add the updated stored procedure and Save again.

    Solved without any hassle :)

提交回复
热议问题