none
Table Value Function support in EF 5.0 RRS feed

  • Question

  • I've read that EF 5.0 support TVFs.

    However, when I upgraded from EF 4.3.1, that feature seemed to have broken.  I had to remove all references of my TVF in the XML file for it to generate the ORM.

    When I update the ORM from the database my TVF does not show up in the list under Functions/Stored Procs.

    Is there something I'm doing wrong?

    I have upgraded to .NET 4.5, used NuGet to get EF 5.0 rc, but still am using Visual Studios 2010 Premium.

    Thanks!

    Monday, June 11, 2012 9:35 PM

Answers

  • Hi John Lee123,

    Welcome to MSDN Forum.

    Please refer to this article, it's a walkthrough of TVF in EF5.0. I think you have to install VS11 for that.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by John Lee123 Tuesday, June 12, 2012 12:56 PM
    Tuesday, June 12, 2012 8:46 AM
    Moderator

All replies

  • Also, I'm targeting Framework 4.0, as .NET 4.5 is a replacement upgrade (formerly I had targeted June 2011 CTP)
    Monday, June 11, 2012 10:00 PM
  • Hi John Lee123,

    Welcome to MSDN Forum.

    Please refer to this article, it's a walkthrough of TVF in EF5.0. I think you have to install VS11 for that.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by John Lee123 Tuesday, June 12, 2012 12:56 PM
    Tuesday, June 12, 2012 8:46 AM
    Moderator
  • Hi,

    Broken that is ? What do you see ? My understanding is that .NET 4.5 being an in place update doesn't mean it "replaces" .NET 4.0 but rather that it "adds" to 4.0. In particular if I remember the EF 5 readme tells explicitely that you still need to target .NET 4.5 to get the new features. A quick check gave from http://blogs.msdn.com/b/adonet/archive/2012/05/15/ef5-release-candidate-available-on-nuget.aspx :

    "Some features are only available when writing an application that targets .NET 4.5. This includes enum support, spatial data types, table-valued functions and the performance improvements. If you are targeting .NET 4.0 you still get all the bug fixes and other minor improvements."


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".

    Tuesday, June 12, 2012 11:26 AM
  • You both are right.  VS2012 is needed to target 4.5 and 4.5 is needed for TVF.

    http://msdn.microsoft.com/en-us/library/hh264218(v=vs.110).aspx

    I guess I need to go out and get VS2012.

    Thanks.


    • Edited by John Lee123 Tuesday, June 12, 2012 12:55 PM
    Tuesday, June 12, 2012 12:54 PM
  • Hi,

    Broken that is ? What do you see ? My understanding is that .NET 4.5 being an in place update doesn't mean it "replaces" .NET 4.0 but rather that it "adds" to 4.0. In particular if I remember the EF 5 readme tells explicitely that you still need to target .NET 4.5 to get the new features. A quick check gave from http://blogs.msdn.com/b/adonet/archive/2012/05/15/ef5-release-candidate-available-on-nuget.aspx :

    "Some features are only available when writing an application that targets .NET 4.5. This includes enum support, spatial data types, table-valued functions and the performance improvements. If you are targeting .NET 4.0 you still get all the bug fixes and other minor improvements."


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".

    Hi. That is true. I just came up with a project targeting Framework 4.0 and I couldn't map TVF. But, when I retargeted the Framework, to 4.5, the Build Project process tells me that "my EF was inserted using a 'different' version of the Framework. So, it asks me to update it. But I don't know... EF 6.0.2... I gotta wait or start a new project and copy and past, if the EF is 5.0 (4.4.0.0 actually). Would it be that course of action?

    Regards to all !


    Helping improve public services through Information and Communication Technology

    Tuesday, December 24, 2013 7:27 PM
  • You both are right.  VS2012 is needed to target 4.5 and 4.5 is needed for TVF.

    http://msdn.microsoft.com/en-us/library/hh264218(v=vs.110).aspx

    I guess I need to go out and get VS2012.

    Thanks.


    True also! Get it from MSDN, if you have an account or Partnership.

    Regards.


    Helping improve public services through Information and Communication Technology

    Tuesday, December 24, 2013 7:28 PM