Inner connection query
select DealerContact.* from Dealer inner join DealerContact on Dealer.DealerID = DealerContact.DealerID
var dealerContacts = from contact in DealerContact join dealer in Dealer on contact.DealerId equals dealer.ID select contact;
clauses, specify the source table (dealercontact). from
The clause uses equal conditions on the dealerid field to link the DealerContact table to the Dealer table. Finally, we use <子> clauses to select the required fields (dealercontact.*). join
select
The alternative method of specific query
This allows you to adjust the query flexibly according to the required output.
var dealers = from dealer in Dealer join contact in DealerContact on dealer.DealerID equals contact.DealerId select dealer;
The above is the detailed content of How to Perform Inner Joins with LINQ to SQL?. For more information, please follow other related articles on the PHP Chinese website!