I added a reference to a stored procedure in my edmx file, then right clicked on it and selected “Create Function Import”, it was added to the Function Imports folder under EntityContainer in the model browser.
As I understand it I should be able to use it like so:
sampleEntities db = new sampleEntities();
db.SampleStoredProcedure();
but it does not show up on the db object. Is there a step I’m missing? The Function Import is set to public, has no return value, and one parameter that I can see when I expand it.
Does your stored procedure return a simple (that is to say scalar) value? If so, the designer will not generate the code for you:
However, this has been fixed in the newest version of the Entity Framework: