我确信这是一种更有表现力的优雅方式
IEnumerable<List<string>> list = api.call();
List<string> distinct = new List<string>();
foreach (var result in list)
{
foreach (var subject in result )
{
if (!distinct.Contains(subject))
{
distinct.Add(subject);
}
}
}
答案 0 :(得分:2)
怎么样: -
SELECT *
FROM items i
WHERE i.fromdate < '2015-12-11 16:00:00'
AND i.todate > '2015-12-11 08:00:00'
AND i.status = 1;
您可以使用SelectMany展平列表并获取不同的项目。