【发布时间】:2013-07-01 19:51:28
【问题描述】:
我有如下的 sql 查询,它排除了从字母 x 开始的行
select * from table where name like 'x%'
我如何使用 Linq 编写它?
我尝试过使用
var query = (from a in _tableARepository.AsQueryable()
join b in _tableBRepository.AsQueryable()
on a.Id equals b.Id
where a.name.contains("x")
select new { a, b});
但这包括所有带有“x”的东西
【问题讨论】: