I am following Nerd Dinner tutorial (with EF) while creating a custom application but came across a problem in validating user input while adding a student to the database.
Lets say I have 3 entities
Student : StdID, StdName
Course: CourseID, CourseName
StdCourse: StdID,CourseID
Since the last table is a bridge table, the edmx file shows only two tables. On the add student page, I want to validate that the user has selected at least one course for the student from the courses list box, before adding the student.
ZahidBashir
Member
86 Points
57 Posts
MVC 2 Validating Many to Many Property
Mar 01, 2012 04:53 PM|LINK
Hi,
I am following Nerd Dinner tutorial (with EF) while creating a custom application but came across a problem in validating user input while adding a student to the database.
Lets say I have 3 entities
Student : StdID, StdName
Course: CourseID, CourseName
StdCourse: StdID,CourseID
Since the last table is a bridge table, the edmx file shows only two tables. On the add student page, I want to validate that the user has selected at least one course for the student from the courses list box, before adding the student.
How can I accomplish this.
Best Regards,
ZB