gpt4 book ai didi

c# - 通过 linq 查询过滤组

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

 var testingAll =          (from ac in metaData.AcTable
where ac.Call >= DateTime.Now.AddMonths(-2) && ac.Call <= DateTime.Now
group adminCall by ac.LanguageCode into acc
select new { lang = acc.Key, count = acc.Count() }).ToDictionary(x => x.lang, y => y.count).OrderByDescending(x => x.Key);

我可以在日期时间之后再次使用过滤器吗?

像这样:

var Today = testingAll.Where( /*x => x.Call >= DateTime.Now.AddDays(-2)*/) 

最佳答案

我想你想要类似的东西

var testingAll =          (from ac in metaData.AcTable
where ac.Call >= DateTime.Now.AddMonths(-2) && ac.Call <= DateTime.Now
group adminCall by adminCall.LanguageCode into ac
select ac

这应该返回一个集合,然后您可以在其中查询多次。

关于c# - 通过 linq 查询过滤组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39634779/

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