C# 从ILookup中选择元组会引发异常

C# 从ILookup中选择元组会引发异常,c#,linq,valuetuple,C#,Linq,Valuetuple,我有一个ILookup,它应该在下拉列表中存储元素的显示信息(在应用程序中仅作为枚举存在) 元组的访问方式如下: public IEnumerable<(int, string, BitmapSource)> EnumerationValues(Type type) { return this._enumerationValues .Where(group => group.Key == type) .Select(gro

我有一个
ILookup
,它应该在下拉列表中存储元素的显示信息(在应用程序中仅作为枚举存在)

元组的访问方式如下:

public IEnumerable<(int, string, BitmapSource)> EnumerationValues(Type type)
{
  return this._enumerationValues
             .Where(group => group.Key == type)
             .Select(group => group.SelectMany<(int, string, BitmapSource),
                                               (int, string, BitmapSource)>(element => element));
}
public IEnumerable枚举值(类型)
{
返回此值。\u枚举值
.Where(group=>group.Key==type)
.Select(group=>group.SelectMany(element=>element));
}
但是,编译器对此表示不满:

无法将lambda表达式转换为预期的委托类型,因为块中的某些返回类型不能隐式转换为委托返回类型


即使写入
element=>(element.Item1、element.Item2、element.Item3)
也会导致相同的错误。这里我做错了什么,类型完全相同。

获取与给定键关联的值的方法是使用索引器。这是专门为返回与该键关联的值序列而设计的操作。试图在整个集合中搜索匹配的密钥会破坏首先进行查找的全部目的,因为它是专门为快速搜索给定密钥而设计的数据结构

public IEnumerable<(int, string, BitmapSource)> EnumerationValues(Type type) =>
    _enumerationValues[type];
public IEnumerable枚举值(类型)=>
_枚举值[类型];

获取与给定键关联的值的方法是使用索引器。这是专门为返回与该键关联的值序列而设计的操作。试图在整个集合中搜索匹配的密钥会破坏首先进行查找的全部目的,因为它是专门为快速搜索给定密钥而设计的数据结构

public IEnumerable<(int, string, BitmapSource)> EnumerationValues(Type type) =>
    _enumerationValues[type];
public IEnumerable枚举值(类型)=>
_枚举值[类型];

我知道我的方法有些奇怪,但我以前从未使用过Lookup类。谢谢。我知道我的方法有些奇怪,但我以前从未使用过查找类。谢谢