从多维列表中选择数据

时间:2016-03-29 00:40:02

标签: c#

有人能帮帮我吗?如何从 [29-Mar-2016 00:35:37 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 List<Episode>获取List<Show>

Episodes.Seen == false

非常感谢您的旅游帮助。

2 个答案:

答案 0 :(得分:2)

使用简单的Linq声明。

var episodes = shows.SelectMany(s=>s.Episodes.Where(e=>e.Seen.HasValue && !e.Seen.Value));

答案 1 :(得分:0)

您可以使用LINQ执行此操作,如下所示:

using System.Linq;

IEnumerable<Episode> unseenEpisodes = (from show in shows
                        from episode in show.Episodes
                        where (episode.Seen.HasValue && episode.Seen.Value == false)
                        select episode);