This question is locked. New answers and comments are not allowed.
I'm sure this is in the docs somewhere, but I've just spent two hours trying to find it. If anyone could point me in the right firection i would really appreciate it.
All I want to do is iterate iterate over some data in a many to many collection, i.e. dump every person and all their addresses.
I'm trying something like this:
Dim scope As Telerik.OpenAccess.IObjectScope
scope = OaMsTest1.ObjectScopeProvider1.GetNewObjectScope
scope.Transaction.Begin()
Dim ext As IQueryable(Of Person)
ext = scope.Extent(Of Person)()
Dim result = From person In ext _
Select person
Dim adds As New List(Of Address)
For Each p In result 'Loop through all People
adds= p.Addresses 'Does NOT work. Can not convert it to a list
Console.WriteLine(p.LastName)
For Each address In p.addresses 'Loop through all addresses for this person
Console.WriteLine(" " & address.StreetName)
Next
Next
Shouldn't it just lazy load the collection when it is referenced? Is there a way to explicitly load it, like p.Addresses.LoadAll ??
Thanks,
All I want to do is iterate iterate over some data in a many to many collection, i.e. dump every person and all their addresses.
I'm trying something like this:
Dim scope As Telerik.OpenAccess.IObjectScope
scope = OaMsTest1.ObjectScopeProvider1.GetNewObjectScope
scope.Transaction.Begin()
Dim ext As IQueryable(Of Person)
ext = scope.Extent(Of Person)()
Dim result = From person In ext _
Select person
Dim adds As New List(Of Address)
For Each p In result 'Loop through all People
adds= p.Addresses 'Does NOT work. Can not convert it to a list
Console.WriteLine(p.LastName)
For Each address In p.addresses 'Loop through all addresses for this person
Console.WriteLine(" " & address.StreetName)
Next
Next
Shouldn't it just lazy load the collection when it is referenced? Is there a way to explicitly load it, like p.Addresses.LoadAll ??
Thanks,