我有一个列被定义为EF(代码优先)中的整数.我想用"start with"来搜索它.现在,我可以这样做:
Where(x => SqlFunctions.StringConvert((double)x.AccountNumber).StartsWith(searchTerm))
Run Code Online (Sandbox Code Playgroud)
然而,SqlFunctions.StringConvert()转换为T-SQL函数STR(),由于我无法理解的原因而留下了结果.
此外,我无法使用,string.TrimStart()因为实体框架不支持它.
任何人都可以提供任何帮助吗?