none
Entity Framework 4.1 new INCLUDE() method not working.... RRS feed

  • Question



  • I am trying some new features in Entity framework 4.1 and one of these were we can now pass lambda expressions as a parameter in the
    include() method... however I'm still not seeing the updated intellisense/changes as well. I have a reference to the most recent update for EF using Nuget.
    Am i missing anything here?

    using
     (PROGRAMMINGEFDB1Context context = new PROGRAMMINGEFDB1Context())             {                 var query = context.Addresses.Include(c => c.Contact.....); <----- I'm only limited to passing a string here and not a lambda expression
                 }

    Thursday, October 27, 2011 3:23 PM

Answers

  • Hi amosC,

    I'm not sure why you wouldn't be seeing it.  Try to put a using statement for "System.Linq.Expressions" and see if you can see it then.   Also, add a using statement for:

    using System.Data.Entity;

     Make sure you have a reference for EntityFramework also in your references list.

     


    Tom Overton

    • Edited by Tom_Overton Thursday, October 27, 2011 4:07 PM
    • Marked as answer by amosC Thursday, October 27, 2011 5:03 PM
    Thursday, October 27, 2011 4:00 PM
  • I had this exact same problem posted a previous post

    "I couldn't use a lambda expression in the Include method because I didn't have the System.Data.Entity using statement."

    William


    WhiskeyRomeoLima
    • Marked as answer by amosC Thursday, October 27, 2011 5:03 PM
    Thursday, October 27, 2011 4:29 PM

All replies

  • Hi amosC,

    I'm not sure why you wouldn't be seeing it.  Try to put a using statement for "System.Linq.Expressions" and see if you can see it then.   Also, add a using statement for:

    using System.Data.Entity;

     Make sure you have a reference for EntityFramework also in your references list.

     


    Tom Overton

    • Edited by Tom_Overton Thursday, October 27, 2011 4:07 PM
    • Marked as answer by amosC Thursday, October 27, 2011 5:03 PM
    Thursday, October 27, 2011 4:00 PM
  • I had this exact same problem posted a previous post

    "I couldn't use a lambda expression in the Include method because I didn't have the System.Data.Entity using statement."

    William


    WhiskeyRomeoLima
    • Marked as answer by amosC Thursday, October 27, 2011 5:03 PM
    Thursday, October 27, 2011 4:29 PM
  • That was it. Adding the using statement fixed it.   I cant believe I missed that.  Also note that somehow my ReSharper tool version 6.00 was messing with the intellisense as well. Apparently this hasnt been fixed yet.

     

    http://stackoverflow.com/questions/5870972/entity-framework-4-1-strongly-typed-include-doesnt-provide-intellisense

    Thursday, October 27, 2011 5:07 PM