I encountered a very strange (and annoying) issue: in MVC 4 web application while loading data from the database and using a foreach on the Model within the view:
@foreach (var meeting in Model)
i have a breakpoint in the method's beginning and examining the object meeting i see that it misses some data (reference to other tables). if I open (+) other object within meeting the missing data appears.
Why?
Thanks!
here is my controller method:
public ActionResult GetMeetingMR(int id = 0)
{
var meetingPurpose = db.MeetingPurposes.ToList();
ViewBag.MeetingPurpose = new SelectList(meetingPurpose, "MeetingPurposeID", "MeetingPurposeName");
ViewBag.MRID = id;
List<Meeting> meetings = (db.MortgageRequests.Find(id)).Meetings.ToList();
return View(meetings);
}