Here are the tables:

I need to retrieve a collection of Student objects, so I can access their names, last names, etc.
I’m kind of stuck so any help is very welcome, I’m always trying to learn and apply new things to make them stick. 🙂
So far, I’ve tried this:
private void cmbGradeParalelo_SelectedIndexChanged(object sender, EventArgs e)
{
int gradeParaleloId = Convert.ToInt32(cmbGradeParalelo.SelectedValue);
using (StudentRepository studentRepo = new StudentRepository())
{
studentRepo.FindAllStudents().Where(s => s.GradeStudents
}
}
.GradeStudents is an EntityCollection<GradeStudent> so I think I can query the data using Linq, but I don’t know how. I’ve never done something like this. 🙂
Thank you for your time!
Yes, you can query with Linq. There is one beginner caveat, though, that being the need for Include:
etc.
If you provide a little more information on what you are trying to do, I might be more help.
Note also that if your join table (GradeStudents) did not have extra columns, it would be an Assocation, and you would have access to GradeParalelo directly from Student.