Consider 3 entities. Group, Box and Message. Each Group contains Boxes and each Box contains Messages.
what’s the neatest way to retrieve Messages inside a Group with custom conditions in Linq To Entitis using lambda expressions?
For example, I want to select messages submitted yesterday in a certain group (thus, the resultr should be IEnumerable<Message>). How can I make the fewest calls to db and filter out results in my db-query?
Update
Got a downvote for not showing my code. That’s because I don’t have any. Question is simple enough. not a homework. Didn’t expect that!
Assuming you have foreign keys in your database and Navigation properties in your model because of this, the following code should do the trick: