数据库中字段值是 ~hello-world(开头字符是波浪号tilde),通过 SQL 语句 and EntryName='~hello-world' 可以正常查询,通过 EF Core LINQ .Where(p => p.EntryName == entryName) 却查询不到,请问如何解决?
~hello-world
and EntryName='~hello-world'
.Where(p => p.EntryName == entryName)
汗,与 EF Core LINQ 没有关系,是查询之前的代码有验证,字符中包含 ~ 会直接返回
~
https://stackoverflow.com/questions/1879429/string-startswith-not-working-with-tilde-characters-linq-to-sql https://www.appsloveworld.com/entity-framework/100/9/sql-generated-by-entityframework-startswith-contains-plan-altering-escape
大概是这个问题?
跟踪瞅瞅最终到server的语句长啥样.