私は次のコードを持っています:
Using dbContext As pbu_housingEntities = New pbu_housingEntities
        ' First, delete all current records associated with the specified semester.
        Dim delete_old = (From p In dbContext.Residents _
                          Where p.semester = txtDestSemester.Text _
                          Where p.year = txtDestYear.Text _
                          Select p)
        dbContext.Residents.DeleteObject(delete_old)
        dbContext.SaveChanges()
End Using
しかし、それは機能しません。タイプ'System.Data.Objects.ObjectQuery'のオブジェクトをキャストできませんというエラーがスローされます。何かご意見は?
私がやろうとしているのは、指定された条件の行のリストを取得してから、返されたすべての行を削除することです。