Entity Framework 7 Core disables automatic loading

I do not use the virtual property for navigation

I want to manually specify the fields to load

IQueryable<ScheduleModel> q = _db.Schedules;
q = q.Include(x => x.ElementItem); <-- load ElementItem
q = q.Include(x => x.ScheduleHours); <-- load collection

But EF7 loads (or assigns) ScheduleHours [0..x] .ElementItem, because ElementItem with the same identifier loaded in the first Include ()

After serializing in Json, I have a big model.

How to disable automatic loading of unspecified fields?

+1
source share

Source: https://habr.com/ru/post/1670239/


All Articles