EF.Functions.Like throws "has no supported translation to SQL" error

I'm using latest beta of LINQPad on .NET 5.0 and with Microsoft.EntityFrameworkCore and Microsoft.EntityFrameworkCore.SqlServer (both version 5.0.9) against SQL Server 2016 SP1.

This query

var customers = from t in Tb_Customer
            where EF.Functions.Like(t.Name, "a%")
        select t;

throws NotSupportedException exception with message

Method 'Boolean Like(Microsoft.EntityFrameworkCore.DbFunctions, System.String, System.String)' has no supported translation to SQL.

Source is SD.Tools.LinqToSQL2.

When I try similar LINQ query in my ASP.NET Core project, there is no error, so query and referenced seems OK.

What am I doing wrong?

Thank you for you help.


Sign In or Register to comment.