Page 1 of 1

System.NotSupportedException with ToList()

Posted: Mon 14 Jun 2010 11:02
by LordFjord
Hello,
I am using dotConnect for Oracle 5.70.140.0

I get a NotSupportedException for the following query:

Code: Select all

List myObject2s = context.MyObjects.Where( n => n.ObjectID == objectID).Select( o => o.MyObject2s ).ToList();
MyObject2 and MyObject are connected via a 1-many assotiation.

I want to retrieve all MyObject2s into a list that belong to a MyObject with the given ID.

Stacktrace

Code: Select all

System.NotSupportedException: Specified method is not supported.   at Devart.Data.Linq.Provider.h.a(ax A_0)
   at Devart.Data.Linq.Provider.h.a(SqlExpression A_0)
   at Devart.Data.Linq.Provider.h.a(bi A_0)
   at Devart.Data.Linq.Provider.h.a(SqlExpression A_0)
   at Devart.Data.Linq.Provider.h.a(SqlExpression A_0, Boolean A_1)
   at Devart.Data.Linq.Provider.m.a(u A_0, SqlExpression A_1, Boolean A_2)
   at Devart.Data.Linq.Provider.m.a(u A_0, SqlExpression A_1)
   at Devart.Data.Linq.Provider.m.a(Type A_0, SqlExpression A_1, u A_2)
   at Devart.Data.Linq.Provider.DataProvider.CompiledQuery.GetReaderFactory(List`1 elementInstanceTypes, u services, SqlNode query)
   at Devart.Data.Linq.Provider.DataProvider.CompiledQuery..ctor(QueryInfo queryInfo, u services, Boolean isQueryObjectByKey, Object queryObjectKey)
   at Devart.Data.Linq.Provider.DataProvider.BuildQuery(Expression query)
   at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Compile(Expression query)
   at Devart.Data.Linq.DataQuery`1.i()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
The same code works on MS SQL Server 2008 with the Microsoft LINQtoSQL libs.

If i divide the query into 2 subqueries (one to retrieve MyObject and one to get the MyObject2 in a seperate query) then it works. Could be an issue with ToList or associations.

Any help would be appreciated.

Posted: Mon 14 Jun 2010 15:37
by AndreyR
I have just tried to reproduce the issue using the latest dotConnect for Oracle 5.70.140 and succeeded.
Could you please send me (support * devart * com, subject "LINQ: NotSupported") a small test project reproducing the issue?