Linq2Oracle: "Sequence contains no matching element"
Posted: Wed 10 Sep 2008 10:25
Hi
I use the Devart Linq2Oracle (Devart.Data.Linq) to access Oracle database from .NET.
I have a problem with iterating through the children of an object.
Our Person object has a OneToMany relationship with a postal adress table(one person may have 0 or more associated postal addresses).
As i try to iterate through the addresses on the Person object, a InvalidOperationException is thrown, with the message "Sequence contains no matching element".
It is really strange, because it works for 3 of my colleagues, but not for me. I have tried to uninstall and install again the Devart components, woth no luck.
I think that this error is thrown because the Devart.Data.Linq.MultiKeyManager invokes the System.Linq.Enumerable.Single method,
where it should invoke the SelectMany method, but i am not sure.
I tried to reproduce the problem with a very simple model, i used the SchemaModeller to import 3 tables with a OneToMany relationship,
and i am able to reproduce this error. But again, not my colleagues.
Have you ever come across this problem?
This is the stack trace:
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.CreateDefault[TType]()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(T A_0)\r\n
at Devart.Data.Linq.Provider.EntityReader`2.a()\r\n
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()\r\n
at System.Data.Linq.EntitySet`1.Load()\r\n
at System.Data.Linq.EntitySet`1.GetEnumerator()\r\n
at ConsoleApplication5.Program.Main(String[] args) in D:\dev\_temp\ConsoleApplication5\Program.cs:line 23\r\n
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n
at System.Threading.ThreadHelper.ThreadStart()"
Regards,
Dennis
I use the Devart Linq2Oracle (Devart.Data.Linq) to access Oracle database from .NET.
I have a problem with iterating through the children of an object.
Our Person object has a OneToMany relationship with a postal adress table(one person may have 0 or more associated postal addresses).
As i try to iterate through the addresses on the Person object, a InvalidOperationException is thrown, with the message "Sequence contains no matching element".
It is really strange, because it works for 3 of my colleagues, but not for me. I have tried to uninstall and install again the Devart components, woth no luck.
I think that this error is thrown because the Devart.Data.Linq.MultiKeyManager invokes the System.Linq.Enumerable.Single method,
where it should invoke the SelectMany method, but i am not sure.
I tried to reproduce the problem with a very simple model, i used the SchemaModeller to import 3 tables with a OneToMany relationship,
and i am able to reproduce this error. But again, not my colleagues.
Have you ever come across this problem?
This is the stack trace:
at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(Type A_0)\r\n
at Devart.Data.Linq.MultiKeyManager`2.CreateDefault[TType]()\r\n
at Devart.Data.Linq.MultiKeyManager`2.a(T A_0)\r\n
at Devart.Data.Linq.Provider.EntityReader`2.a()\r\n
at Devart.Data.Linq.Provider.ObjectReader`1.MoveNext()\r\n
at System.Data.Linq.EntitySet`1.Load()\r\n
at System.Data.Linq.EntitySet`1.GetEnumerator()\r\n
at ConsoleApplication5.Program.Main(String[] args) in D:\dev\_temp\ConsoleApplication5\Program.cs:line 23\r\n
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n
at System.Threading.ThreadHelper.ThreadStart()"
Regards,
Dennis