You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me the query created has some kind of issue:
System.InvalidOperationException: The LINQ expression 'DbSet
.Where(t => t.Propname.Contains("omni"))
.OrderByDescending(t => new Ranked{
Hits = (t.Propname ?? "").Length - (t.Propname ?? "").Replace(
oldValue: "omni",
newValue: "").Length / 4,
Item = t
}
.Hits)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Let me know if any other information could be useful to understand the problem.
The text was updated successfully, but these errors were encountered:
var result = context.Users.Search(x => x.FirstName, x => x.LastName, x.MiddleName)
.Containing("John")
.ToRanked()
.OrderByDescending(r => r.Hits) // Order by Hits property of IRanked
.Take(10);
doesn't work and an exception raises with this message
could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
it works only when you convert the link query to Enumerable before calling OrderByDescending() but that doesn't make sense at all because by this way I get a lot of un needed rows from the database
Code looks like below:
It seems to me the query created has some kind of issue:
System.InvalidOperationException: The LINQ expression 'DbSet
.Where(t => t.Propname.Contains("omni"))
.OrderByDescending(t => new Ranked{
Hits = (t.Propname ?? "").Length - (t.Propname ?? "").Replace(
oldValue: "omni",
newValue: "").Length / 4,
Item = t
}
.Hits)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
Let me know if any other information could be useful to understand the problem.
The text was updated successfully, but these errors were encountered: