Question: Assume I have 2 tables:

**TableA:**, columns: A\_ID, B\_ID

**TableB:**, columns: B\_ID

According to the model diagram I have under TableA the A\_ID column and NavigationProperty of B which looks like only a reference to B. (maybe since it's a FK?)

What bothers me now is that once I load the context.TableA.ToList() rows
and I try to iterate the items in this list, I don't have access to the simple column B\_ID but I only have B, and once doing item.B.ID I get a null reference.

code sample:

```
List<TableA> items = context.TableA.ToList();

foreach(TableA item in items)
{
    item.B.ID <- null reference.
}

```

I know this is probably the idea behind LINQ but I think my approach is wrong. Could anyone
please explain how I can correctly load the entire table with its columns? And how these principles of LINQ are reflected in my example?

Please provide code samples :)

Answer: 
[This article](http://msdn.microsoft.com/en-us/data/jj574232.aspx) may give you the solution.

You need to eagerly load the related entities.
As we discussed in chat, Entity Framework syntax has changed, and keeping up to date, with the current Entity Framework 5 will ensure that examples listed on various pages stay relevant.