我正在做一个 asp.net core 6.0 项目
query = query.Where(d => EF.Functions.ILike(d.Id.ToString(), $"%{keyword}%"));
当我尝试使用ILike
时,
我收到了这个错误'DbFunctions' does not contain a definition for 'ILike' and no accessible extension method 'ILike' accepting a first argument of type 'DbFunctions' could be found (are you missing a using directive or an assembly reference?)
我using Microsoft.EntityFrameworkCore;
也添加了参考。
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.1" />
</ItemGroup>
为什么会出现这个错误?