현재 중첩 된 linq에 문제가 있습니다.MVC4 면도기의 중첩 된 Linq
여기에 내 테이블이며 지금은 MVC4 면도기 웹 응용 프로그램을 개발하고 있습니다.
student
student_id,studentname,description
book
book_id,student_id,bookname,checkitout
booker
bookerid,book_id,bookername,bookerdescription
은 내가 모두 여기 내 테이블을
public class student_model{
public int student_id {get;set;}
public string studentname {get;set;}
public string bookname {get;set;}
}
안녕을 표시하기위한 모델을 작성하고 지금은 MVC4 면도기 웹 응용 프로그램을 개발하고있다. booker에 중첩 된 LINQ를 쓰고 싶습니다. 그래서 다음 LINQ를 사용합니다 :
public List<student_model> finder (int stuid){
var stubk = (from stu in contx.students
join bk in contx.books on stu.student_id equals bk.student_id
where stu.student_id == stuid
select new {
//here is wrong
student = from bker in contx.bookers
where bker.book_id=bk.book_id
select new student_model{
student_id = stu.student_id,
studentname = stu.studentname,
bookname = bk.bookname
}
}).ToList();
var next = stubk.Select(md=>md.student)
return (List<student_model>) next;
}
중첩 된 LINQ가 잘못되었습니다. 그렇다면 필터를 만들기 위해 어떻게해야합니까? bookers.book_id = bk.book_id
? 어떻게해야합니까 (List<student_model
)?
감사 개구리