gpt4 book ai didi

c# - 选择子句为空

转载 作者:太空宇宙 更新时间:2023-11-03 11:03:00 26 4
gpt4 key购买 nike

我正在使用

your = from p in (toSelect)
select new
{
last = p.Last,
current = p.CurrentPlayer,
seats = from s in (p.Seated)
select new
{
UID = s.UID,
buyin = s.BuyIn
}
}

p.Seated 是一个数组,每次 s.UID 未设置时如何传递 null?我知道“where”,但我想知道哪些座位是免费的(例如 null)

希望这已经足够清楚了。

最佳答案

你可以试试这个:

your = from p in (toSelect)
select new
{
last = p.Last,
current = p.CurrentPlayer,
seats = p.Seated.Select(s => s.UID != null
? new
{
UID = s.UID,
buyin = s.BuyIn
}
: null;
}

关于c# - 选择子句为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16984496/

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