linq延遲加載的問題

使用Linq的時候常會遇到延遲加載帶來的問題,好比2個表class(id,name),student(id,classId,name)html 當從數據層取到某個student對象後,想要取他對應的班級的名稱,則會報上下文環境以被釋放的錯誤!post 代碼以下:htm 數據層: 對象          public student getStudentById(int id)blog       
相關文章
相關標籤/搜索