Hi
I have the following code for the SelectedIndexChanged event of a drop down list. This works fine as it is but this entity has a relationship to another entity (Genre). if i change the select statement to { m, m.Genre.MovieGenre }).ToList(); it doesnt work as contains anonomyous types.
How would i go about doing this. Still trying to get to grips with all this so apologise if i havent explained very well!
//get dvd
using (var context = new dvd3Entities())
{
int id = Convert.ToInt32(ddlDvd.SelectedValue);
List<Movie> movies = (from m in context.Movies
where m.Id == id
select m).ToList();
if (movies.Count() > 0)
{
Movie movie = movies[0];
txtTitle.Text = movie.Title;
txtYear.Text = movie.Year;
}
thanks