The extension method is:
<Extension>
Public Function ReadUncommitted(Of T)(ByVal source As IQueryable(Of T), ByVal obj As Expressions.Expression(Of Func(Of T, T))) As IQueryable(Of T)
Return CreateQuery(source, Function(s) s.ReadUncommitted(obj))
End Function
Private Function CreateQuery(Of T, TR)(ByVal source As IQueryable(Of T), ByVal expression As Expressions.Expression(Of Func(Of IQueryable(Of T), TR))) As IQueryable(Of T)
Dim newQueryExpression = ReplacingExpressionVisitor.Replace(
expression.Parameters(0),
source.Expression,
expression.Body
)
Return source.Provider.CreateQuery(Of T)(newQueryExpression)
End Function
This creates a (prepared) statement like:
SELECT TABLE-REF(q0) AS value FROM (SELECT TABLE-REF(UnresolvedTableInfoWithAddition(Address)) AS value FROM TABLE(Address)) [q0] WHERE ((TABLE-REF(q0).ID == 1) OrElse (TABLE-REF(q0).ID == 5))
My problem is I don't want to have this TableReference select clause ("q0").
I quess the problem is that I replaced the original source expression with my expression and so introduces a new query source.
How can I omit that?
I just want to get my result operator called without changing or introducing any query source. Like you mentioned, I just want to annotate tables.