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
- @Html.DisplayFor(modelItem => item.regs.FullName)
@Html.DisplayFor(modelItem => item.Course_Tags)
but i am getting this below error message
Suraj KumarPosted Jan 18, 2020, 4:26 PM
Jignesh KumarPosted Jan 18, 2020, 1:36 PM
Mark TaborPosted Jan 17, 2020, 3:29 PM
Piyush PansuriyaPosted Jan 17, 2020, 2:59 PM
Rupesh KahanePosted Jan 17, 2020, 2:51 PM