This project is read-only.


Code first to support UDF mapping


When will code first support queries that map to udf's
Closed Dec 12, 2016 at 10:30 PM by RoMiller
EF Team Triage: We are transitioning this project to GitHub ( As part of this transition we are bulk closing a large number of issues in order that our new issue tracker will accurately reflect the work that our team is planning to complete on the EF6.x code base.

Moving forwards, our team will be fixing bugs, implementing small improvements, and accepting community contributions to the EF6.x code base. Larger feature work and innovation will happen in the EF Core code base ( Closing a feature request in the EF6.x project does not exclude us implementing the feature in EF Core. In fact, a number of popular feature requests for EF have already been implemented in EF Core (alternate keys, batching in SaveChanges, etc.).

This is a bulk message to indicate that this issue was closed and not ported to the new issue tracker. The reasons for not porting this particular issue to GitHub may include:
  • It was a bug report that does not contain sufficient information for us to be able to reproduce it
  • It was a question, but sufficient time has passed that it's not clear that taking the time to answer it would provide value to the person who asked it
  • It is a feature request that we are realistically not going to implement on the EF6.x code base
    Although this issue was not ported, you may still re-open it in the new issue tracker for our team to reconsider ( We will no longer be monitoring this issue tracker for comments, so please do not reply here.


RoMiller wrote May 19, 2014 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, 2014 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:

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

Hope this helps,

moozzyk wrote Aug 11, 2014 at 5:41 PM

Scalar functions are now supported by the convention that enables using store functions with Code First. See: