EFCore中怎么表示Mysql中的三种模糊查询
EFCore中对应Mysql中的三种模糊查询:
- Like’%xxx%’:
DbContext.TableInfo.Where(p => stringList.Contains(p.id))
- Like’xxx%’:
DbContext.TableInfo.Where(p => p.Name.StartsWith("XXX"))
- Like’%xxx’:
DbContext.TableInfo.Where(p => p.Name.EndsWith("XXX"))