Hello,
I use dotconnect for Oracle LINQ features.
I need to run the following query:
var test =
objDataContext.Customers.Join(
objDataContext.ExecuteQuery("select * from vw_customers"), a => a.Id,
b => b.Id, (a, b) => a);
int i = test.Count();
The View returns Customers and is custom created by the User of the application. I need to join them to the real Customers table and filter accordingly. Nevertheless, i get the following error:
System.NotSupportedException: {"Constant cannot be sequences."}
at Devart.Data.Linq.Provider.Query.bk.a(SqlNode A_0)
at Devart.Data.Linq.Provider.Query.bk.a(Expression A_0)
at Devart.Data.Linq.Provider.Query.bk.a(Expression A_0, Expression A_1, LambdaExpression A_2, LambdaExpression A_3, LambdaExpression A_4)
at Devart.Data.Linq.Provider.Query.bk.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.bk.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.bk.a(Expression A_0, LambdaExpression A_1, SqlNodeType A_2, Type A_3)
at Devart.Data.Linq.Provider.Query.bk.b(MethodCallExpression A_0)
at Devart.Data.Linq.Provider.Query.bk.j(Expression A_0)
at Devart.Data.Linq.Provider.Query.bk.i(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.a(Expression A_0)
at Devart.Data.Linq.Provider.DataProvider.h(Expression A_0)
at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
Exception in Join
Ok, this seems to be fair enough.
Nevertheless, what is the purpose of the signature of Join extension method:
public static IQueryable Join(
this IQueryable outer,
IEnumerable inner,
Expression> outerKeySelector,
Expression> innerKeySelector,
Expression> resultSelector
)
where the inner parameter is an IEnumerable and not an IQueryable? Is it wrongly defined in this way?
Nevertheless, what is the purpose of the signature of Join extension method:
public static IQueryable Join(
this IQueryable outer,
IEnumerable inner,
Expression> outerKeySelector,
Expression> innerKeySelector,
Expression> resultSelector
)
where the inner parameter is an IEnumerable and not an IQueryable? Is it wrongly defined in this way?
We will implement in DataContext in the next build. It will work like DataContext.ExecuteQuery but return IQueryable with all its advantages.
Code: Select all
public IQueryable Query(string query)
The new build of dotConnect for Oracle 5.25.42 is available for download now.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=15737 .
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=15737 .