1
Vote

Code first to support UDF mapping

description

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

comments

RoMiller wrote May 19 at 6: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 3: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:

https://github.com/divega/UdfCodeFirstSample

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

http://blog.3d-logic.com/2014/04/09/support-for-store-functions-tvfs-and-stored-procs-in-entity-framework-6-1/

Hope this helps,
Diego

moozzyk wrote Aug 11 at 5: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/