How to add a stored function in the Entity Framework

I am trying to add a sql (stored) function in the Entity Framework, but to no avail. I tried to right-click on the table in .edmx and "Import Function", but the function is not displayed there, although I added it (updated model from the database).

Does anyone have a solution for this?

+3
source share
1 answer

You just need to convert the stored function into a stored procedure in SQL. Although the Entity Framework defines stored procedures as functions or lists of stored functions in stored procedures, stored functions are not compatible with the Entity Framework. You can "Update the model from the database ..." and add stored procedures, then right-click and add "Import functions ..."

+3
source

Source: https://habr.com/ru/post/1755946/


All Articles