我需要將Linq加入4個tabel。但它表明我這個錯誤:無法在asp mvc中隱式轉換類型'System.Collections.Generic.List
錯誤1無法隱式轉換類型 'System.Collections.Generic.List <>' 到 'System.Collections.Generic.List' E:\ MyProject的\ GoKhoda \ GoKhoda \地區\類\ StudentsFunc.cs 20 20 GoKhoda
這是我的代碼:
public List<Tbl_Students> ShowAllStudents()
{
var qstudent = from s in _db.Tbl_Students
join pr in _db.Tbl_Pye_Reshte on s.StudentID equals pr.StudentID
join r in _db.Tbl_Reshte on pr.ReshteID equals r.ReshteID
join p in _db.Tbl_Paye on pr.PayeID equals p.PayeID
orderby p.PayeID descending
select new { StudentName = s.StudentName, StudentFamily = s.StudentFamily, StudentImage = s.StudentImage, StudentPayeName = p.PayeName, StudentReshtName = r.ReshteName };
return qstudent.ToList();
}
爲什麼顯示我的錯誤?我該如何解決這個問題?
這個異常沒有告訴我們可以告訴你的那麼多。 –