I was under the impression that the LINQ query language worked for IObservable as it does for IEnumerable with the ReactiveExtensions. I have the following code
Public Sub Foo(source As IObservable(Of Tuple(Of Integer, Integer)))
Dim filtered = source.Where(Function(x) x.Item1 > 10).Select(Function(x) x.Item1 + x.Item2)
Dim filtered2 = From x In source Where x.Item1 > 10 Select x.Item1 + x.Item2
End Sub
Public Sub Bar(source As IEnumerable(Of Tuple(Of Integer, Integer)))
Dim filtered = source.Where(Function(x) x.Item1 > 10).Select(Function(x) x.Item1 + x.Item2)
Dim filtered2 = From x In source Where x.Item1 > 10 Select x.Item1 + x.Item2
End Sub
The code for the IEnumerable version is OK. However for the LINQ version of Foo ( second line ) I get a late binding disallowed error on
x.Item1
When I hover over x the Intellisense says it is of type object instead of type tuple. However the object query version of the same operation ( first line ) compiles ok. I've imported
Imports system.reactive.linq
Am I missing another reference?