Suppose I have an Entity Order with OrderDetails as child preperty.
I enable lazyloading like this:
_context.ContextOptions.LazyLoadingEnabled = true;
I Can feed a view with a method like this:
Order.GetAll()
And navigate by the order details automatically without getting the wirerd “Object reference not set to an instance of an object” error??
If you have lazy loading, when you load up the objects you need to explicitly include the sub objects.
So Order.GetAll() will include
Another alternative is to load up the order details later, like so: