EntityFramework 4 upgraded to 5, lambda is not available

后端 未结 1 1730
臣服心动
臣服心动 2021-01-04 19:20

I have upgraded my \"entityframework 4\" project to 5. I want to use lambda expression in Include (my motivation is to suplant string definitions) brackets.

At this

相关标签:
1条回答
  • 2021-01-04 19:59

    The lambda version of the Include is declared in the System.Data.Entity.DbExtensions class as an extension method.

    In order to use it you need to add an using with the right namespace in your file the:

    using System.Data.Entity;
    
    //...
    
    context.WarrantyContract.Include(w => w.Car);
    
    0 讨论(0)
提交回复
热议问题