String.Contains won't work in EF Core 3.0
In the past, when I used EF Core 1.1, I can use String.Contains() in where to preform string like search.
Such as:
_db.Customers.where(x=>x.FirstName.constains("michael"))
But we moved to EF Core 3.0. I found that is a problem, I got the exception regarding the LINQ translation. This sort of helper function in where is no longer support.
I need to re-write the query, like this:
_db.Customers.Where(x=>EF.Functions.Like(x.FirstName, "%michael%")
)
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 1110 feedbacks awaiting moderation...
Form is loading...