select * form autor
inner join (carte inner join carte_autor using id_carte)
using id_autor
group by id_autor;
How can I write this using LINQ?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’re creating the DataContext using the designer and have foreign keys defined appropriately, these should show up as properties on your entity classes, either Entity or EntitySet, depending on whether it is 1-1 or 1-many. You can also define the relationships in the designer if you don’t have foreign keys assigned.
Otherwise, you can do something like:
Note that this will select out an anonymous type. I find that generally when doing a join I end up selecting a subset of properties into an anonymous (or sometimes named) type, not the actual entities comprising the join. That’s why I’ve shown it this way. You can, of course, keep the full objects around and adjust the select/groupby accordingly.