Hi!
When I am inserting data into the empty table and retrieving the data the Navigation property is null.
Eg. I have a table called Inventory and it has a Navigation properties called Type and Status.
without disposing the DbContext I am retrieving the data by passing the id.
at this point, the status and type models are null thought it has data.
Inventory: Inv_id Inv_nme type_id status_id
when i say : inventory.type.type_name
I am getting an error saying null instance of an object.
To avoid the issue temporarily Eager Loading method using Include to call the submodels:
By using lazy load how can i get the navigation properties data like :
inventory.type.type_name
inventory.status.status_name