-
-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Code looks like below:
return await _entities.Search(x => x.Propname).Containing(keywords.Split(' '))
.ToRanked().OrderByDescending(x => x.Hits)
.Select(x => x.Item)
.ToListAsync();
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels