如何使用C#向LINQ查询添加字符串?

hxzsmxv2  于 2022-12-15  发布在  C#
关注(0)|答案(1)|浏览(183)

我想在LINQ中连接一个字符串,我的查询是:

var OnePoste =
    from cr in bd.Staxe
    where cr.Date_Comm >= dateTime1 && cr.Date_Comm <= dateTime2
    select cr.Id;
mystring = " && (coutCommInt1 == 0 || cr.Mt_Comm_C >= coutCommInt1)
             && (coutCommInt2 == 0 || cr.Mt_Comm_C <= coutCommInt2)"

如何在LINQ查询中添加mystring

sgtfey8w

sgtfey8w1#

“嗨""我想写"

var OnePoste =
    from cr in bd.Staxe
    where cr.Date_Comm >= dateTime1 && cr.Date_Comm <= dateTime2 + mystring 
    select cr.Id;

相关问题