【发布时间】:2011-04-09 14:41:54
【问题描述】:
我有以下 LINQ-to-Entities 查询:
' Get all the residency assignments that match the term/year.
Dim assignments = From p In dbContext.Residents _
Where p.semester = term _
Where p.year = year _
Select p
这将为我提供当前年度/学期的所有居民分配。然后我有这个 LINQ-to-Entities 查询:
Dim reset_occupancy = From p In dbContext.Rooms _
Select p
这会给我所有的房间。我想遍历分配并根据分配的房间更新reset_occupancy中的占用率。我不是 100% 确定如何做到这一点。这是我想要完成的伪代码:
For each row in assignments
reset_occupancy.Where(reset_occupancy.room=assignment.occupancy).current_occupancy =+1
Next
【问题讨论】:
标签: asp.net vb.net entity-framework entity-framework-4 linq-to-entities