I am new to Entity Framework.
I have get to some values in my database using EF. It returns perfectly, and the values are shown in labels. But When I delete all valu
EF will not load changes unless you re query the context. EF queries db and loads maps them into objects, it watches changes you perform on objects and not on the database. EF does not track changes made directly to database and it will never track.
You have loaded a List, that List is your cache in memory. Even calling Save Changes will not refresh. You will have to query the context once again, that is create new list.
To see changes You will have to execute following line once more,
datamodel.Compliances.Where(c => c.School.DistrictId == districtId).ToList()