Code first to support UDF mapping


When will code first support queries that map to udf's


RoMiller wrote May 19 at 5:54 PM

EF Team Triage: We don't have definite plans to add UDF support in a particular release (though we do want to add it). Moving this request to Future. We are following up as we think you may be able to achieve this by manipulating the Code First model directly. We'll post back with details shortly.

divega wrote May 20 at 2:21 AM

Although UDFs are not supported in Code First model out of the box, it is possible to leverage some of the extensibility points (e.g. model conventions) included in EF6 to make it work. I have put together a simple example for a scalar UDF defined in the database here:


Pawel's extension project for EF works for more complex functions, including TVFs and stored procedures:


Hope this helps,

moozzyk wrote Aug 11 at 4:41 PM

Scalar functions are now supported by the convention that enables using store functions with Code First. See: http://blog.3d-logic.com/2014/08/11/the-beta-version-of-store-functions-for-entityframework-6-1-1-code-first-available/