Stored Functions with Linq for Objects

How to make MS-SQL stored function availabe in LINQ expressions if you use Entity framework?

The SQL function was created using CREATE FUNCTION MyFunction(@name) ...). I was hoping to access it similarly to this:

var data = from c in entities.Users where MyFunction(c.name) = 3;

Unfortunately, I only have .NET 3.5.

+3
source share
1 answer

In fact, you can import DB functions into EF 1 . But you are not getting EdmFunctionAttributeinto EF 1, so you are limited to contexts in which you can use them. For this you need EF 4.

proc, Users ( 3.5; , 4 ).

+1

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


All Articles