Eager Loading in Entity Framework

Entity Framework (EF) does not support lazy loading. You must explicitly load the comments advising the EF what to include.

Using ctx as new MyDataContext()

lvComments.DataSource = ctx.Entity.Include(“SomethingToInclude”).First().Comments
lvComments.Databind()

End Using

Or

Using ctx as new MyDataContext()

Dim MyListOfSomething as List(of ListOfSomething) = ctx.ListOfSomething
MyListOfSomething.SomethingToLoad.Load()
lvComments.DataSource = MyListOfSomething.Comments
lvComments.DataBind()

End Using