LINQ queries are lazy loading – that means execution of reading is delayed until it’s iterated. Once set in the LINQ Select statement, the value stored in the result are set as READ ONLY hence setting the value in a FOREACH loop will not really update its data. For example: !--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 var schedules = from roomRate in _entities.RoomRates 2 select new ScheduleViewModel 3 { 4 RoomTypeId = roomRate.RoomTypeId, 5 Rates = roomRate.Rates,...
Subscribe to:
Posts (Atom)