i have a many to many relationship tables, movie and tag in code first approach in my MVC application. i want the user to be able to select all movies that is associted with tag. for example i want to select all movies that has tag id =2. i need lambda query that will allow me do this.Any help with appreciated.
Share
This is one way:
This will return an empty collection if there is no tag with Id=2.
Alternative (which will return
nullif there is no tag with Id=2):If you also want the
Tagentity you could just load it including its movies:tag2.Movieswill contain the movies with tag Id=2.