Answered Function Import option in Linq To Entities model designer?

  • Friday, June 20, 2008 7:08 PM
     
     

    I used the Add > Function Import feature in my model's .edmx diagram by selecting a stored procedure.

     

    It then appears in the Model browser tab as

     

    EntityContainer:myEntities > Function Imports > MyFunction

     

    How do I reference that function or method in my code?  The propeties say it should be part of the myEntities.MyFunction

    but it doesn't appear in Intellisense anywhere when I create the entities instance??

     

All Replies

  • Tuesday, June 24, 2008 7:15 PM
     
     Answered

    What is the return type of your function? In V1, the code for imported functions will only be generated if the return type is mapped to an Entity Type in the model.

     

    If you wish to return a primitive type (or nothing at all), then check the work-arounds in the following thread:

     

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2643093&SiteID=1

     

    Chris

     


    This posting is provided "AS IS" with no warranties, and confers no rights.