Linq Group 使用 Func加入?
我有 IEnumerable
和 IEnumerable
我想根据 A.Test(B)
是否返回 true
进行分组加入。
键选择器函数似乎没有这样做,因为 KeySelector 需要返回相同类型的键,以便可以检查它们是否相等。
我在这里缺少什么吗?
I haveIEnumerable<A>
and IEnumerable<B>
I want to Group Join based on whether A.Test(B)
returns true
.
The keyselector funcs do not seem to do this as the KeySelectors need to return keys of the same type so that they can be checked for equality.
Is there something I'm missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是对的,
GroupJoin
无法真正处理这种情况。这个解决方法可以吗?
You're right,
GroupJoin
can't really handle this case.Will this workaround do?