EF Core 2.1 DbFunctions不包含“ FreeText”的定义

时间:2018-08-26 13:06:22

标签: asp.net entity-framework-core

我正在尝试使用EF Core 2.1中的FreeText函数,该函数是https://github.com/aspnet/EntityFrameworkCore/issues/11481的一部分

我的项目具有以下软件包:

<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.2" />

但是我无法让FreeText注册-出现以下错误:

 'DbFunctions' does not contain a definition for 'FreeText' and no extension method 'FreeText' accepting a first argument of type 'DbFunctions' could be found (are you missing a using directive or an assembly reference?)

这是我的代码,在顶部,我有一个使用Microsoft.EntityFrameworkCore的导入

return await _context.Insights
    .Where(f => EF.Functions.FreeText(f.Heading, query))

0 个答案:

没有答案