我有
Dictionary<string,IEnumerable<string>> pathAndItems = new Dictionary<string,IEnumerable<String>>();
如
this/is/path/: {hey, ho, lets, go}
another/path/: {hey, hello}
我想要做的是使一个具有所有连接值的 IEnumerable 。
this/is/path/hey, this/is/path/ho, this/is/path/lets, this/is/path/go, another/path/hey, another/path/hello
我可以将所有内容合二为一,但是如何为每个内容添加密钥?
var SL_requirements = SL_requirementsDict.SelectMany(kvp => kvp.Value);
编辑:我想把它作为一个 LINQ 表达式而不是循环