gpt4 book ai didi

c# - 有条件的

转载 作者:太空宇宙 更新时间:2023-11-03 21:38:50 25 4
gpt4 key购买 nike

<分区>

我需要在 linq 中编写一个条件查询:

如果 field.val1 == 0:

var q = from field in cw.fields
select field

如果 field.val1 != 0 和 field.val2 == 0:

var q = from field in cw.fields
where field.val1 == 1
select field

如果 field.val1 != 0 和 field.val2 != 0:

var q = from field in cw.fields
where field.val1 == 1 and field.val2 == 1
select field

我该怎么做?

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