There are Q+A's for Entity Framework LIKE's in the Full .net framework:
How to do SQL Like % in Linq?
Like Operator in Entity Framework?
eg:
from c in dc.Organization
where SqlMethods.Like(c.Boss, "%Jeremy%")
This doesn't work in EF Core:
The name SqlMethods does not exist in the current context.
So how do you do a LIKE using Entity Framework CORE?
EF Core 6.0 itself is 31% faster executing queries. Heap allocations have been reduced by 43%.
To use Entity Framework 6, your project has to compile against . NET Framework, as Entity Framework 6 doesn't support . NET Core. If you need cross-platform features you will need to upgrade to Entity Framework Core.
The LIKE function has moved under EF.Functions
in Core:
from c in dc.Organization
where EF.Functions.Like(c.Boss, "%Jeremy%")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With