I'm trying the following query:
Return _context.companies _
.Where(Function(c) c.id.StartsWith(filterCompanyId)) _
.ToList()
but because id
is an integer, it doesn't work. I found this answer which suggests I can use
c.id.ToString().StartsWith ...
but that gives me the following error:
LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
When trying to use
.Where(Function(c) SqlFunctions.StringConvert(CDbl(c.id)).StartsWith("1"))
it doesn't work.
Any tips?