我正在将sql server
查询转换为linq
SELECT * FROM DataFlow where FlowDeleted = 0 and
DataFlow.FlowVersionNumber =
(
SELECT MAX(FlowVersionNumber) from DataFlow i
where FlowDeleted = 0 AND
i.FlowCounter = DataFlow.FlowCounter
group by FlowCounter
)
ORDER by 1
我的 Linq 查询代码是:
public List<DataFlow> getdataflow()
var dflow = db.DataFlows.Where (
d => d.FlowDeleted == false &&
d.FlowVersionNumber =
(
db.DataFlows.Where(i => i.FlowDeleted == false && i.FlowCounter == d.FlowCounter).GroupBy(g => g.FlowCounter)
.Select(s => s.Max(m => m.FlowVersionNumber))
)
)
.Select(s =>
new DataFlow
{
FlowCounter = s.FlowCounter,
FlowDescription = s.FlowDescription,
FlowName = s.FlowName,
}).OrderBy(o => o.FlowCounter);
return dflow.ToList();
}
但它给出的错误如下:Operator '&&' cannot be applied to operands of type 'bool' ... 'string'"
请帮我