0

I want import my function from SQL Server into my ASP.NET MVC project with EF6 database first.

My problem is when I update database in .edmx file, based on what I found in the sources, I open Model Browser but in this file I can't use "Add function import" because stored procedure / function name is empty.

What do you think? What is my mistake?

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Cawboy
  • 123
  • 2
  • 8

1 Answers1

1

Finally I couldn`t find what was the problem, but I got answer by this solution :

I create an stored procedure and called my function in it. after that I added stored procedure in my project as easy as possible.

Cawboy
  • 123
  • 2
  • 8
  • 1
    You can't call a SQL function from EF (or any other data access technology) - you've done the right thing by wrapping it in an SP. – Nugsson Mar 12 '21 at 15:59