Hi I am having a mvc web application in which I have four tables and i am using below linq query to get all columns from all tables and i inspect it using debugging it is getting all data from all four tables ,
- var dept = from s in db.Teacher_courses
- join ce in db.Courses on s.CourseId equals ce.Course_Id
- join se in db.Semesters on s.Semester_Id equals se.Semester_Id
- join re in db.Registration on s.Teacher_Id equals re.User_Id
- where ce.Course_Id == s.CourseId
- select s;
I have below Model class previously i was only getting data from Teacher_Courses Table but now I need to add more columns like semester,Registration and Courses table , so for experiment I just wrote the above query and inpect it using debugging it is getting all fields values from all tables , so I add one more property to my model class for Courses_TAGS as shown below
and i am using it in my view as shown below
- <td>
- @Html.DisplayFor(modelItem => item.regs.FullName)
- </td>
- <td>@Html.DisplayFor(modelItem => item.Course_Tags)</td>
but i am getting this below error message