my code is
var model = dt.FishEventScheduleVaccination
.Join(
dt.FishEventSchedule,
vaccination => vaccination.ScheduleId,
schedule => schedule.ScheduleId,
(vaccination, schedule) => new { vaccination, schedule }
)
.Select(q=>new {
q.vaccination,
q.schedule
})
.Where(w=>w.schedule.Start>DateTime.Now).ToList();
var rtn=new List<FishEventScheduleVaccination>();
foreach (var m in model) {
var item = m.vaccination;
item.FishEventSchedule = m.schedule;
rtn.Add(item);
}
i want do with only lambda query, not foreach. how can i do? Is it possible?
.ForEach(x => {...})method, but this results in a loop, too. If you need a loop. you need a loop.