gpt4 book ai didi

c# - 在带有 Join 子句的 linq 的多个 where 子句中使用 Trim

转载 作者:行者123 更新时间:2023-12-02 00:26:11 24 4
gpt4 key购买 nike

我的表格中的一列有间距。我尝试使用 linq 查询它,但出现错误。代码是:

(from t1 in table1
join t2 in table2
on t1.t2_Id equals t2.Id
where t1.status == "Active"
where t2.column_value.Trim() == parameter
select t1).ToList();

错误是:

Invalid 'where' condition. An entity member is invoking an invalid property or method.

如何修剪列?

最佳答案

你需要这样做。要加入条件,您需要根据您的要求使用 &&||

from t1 in table1
join t2 in table2
on t1.t2_Id equals t2.Id
where t1.status == "Active"
&& t1.column_value.Trim() == parameter
select t1).ToList();

关于c# - 在带有 Join 子句的 linq 的多个 where 子句中使用 Trim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26390454/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com