本文介绍了实体框架核心2.2中的急切加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否已删除Entity Framework Core 2.2急切加载? include方法不会出现在Visual Studio intellisense中,当我手动编写它时,它会给出一个错误:它不包含'include'的定义,也没有可访问的扩展...



示例

 学校= _context.Students.Include ... 

我的演示是使用简单的ASP Core 2.2进行的。 Web应用程序。改变不大。该项目使用以下程序包:

 < ItemGroup> 
< PackageReference Include = Microsoft.AspNetCore.App />
< PackageReference Include = Microsoft.AspNetCore.Razor.Design Version = 2.2.0 PrivateAssets = All />
< PackageReference Include = Microsoft.EntityFrameworkCore.Sqlite.Core Version = 2.2.0 />
< / ItemGroup>


解决方案

不,它仍然。

好像您在using 语句。 com / isak-glans / ExistingDbAndCoreLib / blob / b3beafbc732f0afec9cf053e18c923642a76d270 / ExistingDbAndCoreLib / Pages / Index.cshtml.cs rel = nofollow noreferrer>代码:



<$ $ p> 使用Microsoft.EntityFrameworkCore;


Have Entity Framework Core 2.2 removed Eager Loading? The include method won't appear in Visual Studio intellisense, and when I write it manually it gives an error: "it does not contain a definition for 'Include' and no accessible extensions..."

Example

School school = _context.Students.Include... 

My demo is made with a simple ASP Core 2.2. Web Application. Not much have been changed. The project use this packages:

<ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.0" />
  </ItemGroup>
解决方案

No, it still exists.

Looks like you are missing the following using statement in your code:

using Microsoft.EntityFrameworkCore;

这篇关于实体框架核心2.2中的急切加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 04:29