We were previousing using a seperate db context per function like
using MyEntities db = new();
This was fine however since we have swapped to dependency injection we have found that since the dbcontext persists for each request when creating a new entity and saving with SaveChanges() the lazy loading relationships aren’t available.
This is causing a number of runtime errors, and we have determined that we would either need to use .Include to force the load or to set the state of the entity as Detached.
However this process would require a lot of changes, im wondering if there is a better solution such that the lazy loading properties were always available.