3

I'm trying to add a sql (stored) function to Entity Framework, but unsuccessfully. I tried with right clicking on a table in .edmx and "Function Import", but the function is not shown there, although I added it (updated model from the database).

Does anyone have solution for this?

1
  • Helio's suggestion to convert to stored procedures is probably the best solution in many situations. Another approach is to hand-code a CreateQuery call as suggested by Evil Pigeon on this SO post. Commented Sep 18, 2014 at 22:35

1 Answer 1

3

You should be able to simply convert a stored function into a stored procedure in SQL. Although Entity Framework defines stored procedures as functions or lists stored functions under Stored Procedures, stored functions are not compatible with Entity Framework. You can "Update Model from Database..." and add Stored Procedures then right click and add "Function Import..."

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.