So I'm trying to do something that I would think is fairly straightforward. I have an entity (MasterOrder) that has children (Orders). I am loading the data / relationship in via the CSV loader.
When I attempt to run a MasterOrder through a processing method though, and it attempts to loop through the Orders, there are none there.
Which is weird because as soon as I add a line like
var orders = _db.Orders.ToList();
in before calling the processing method, they ARE there, both in the "orders" variable via debug and in the normal loop where they weren't showing up before.
All fairly normal EF setup on all of this, nothing special.
Any idea why I would be seeing this? Only caveats I have:
- The MasterOrder processing method is async and is awaited.
- Test method itself is async.
- Test runner is NUnit.
- On DbContext we have LazyLoadingEnabled set to false
I have a suspicion its that last one, but just wanted to make sure I understood what the issue is.