c# - Make a SQL Query to LINQ -
this question exact duplicate of:
- make sql query nhibernate 2 answers
how sql query linq?
select customer.name company inner join customer on company.companyid = customer.companyid companyid = 2
you try one:
var result = c in companies join cu in customers on c.companyid equals cu.companyid c.companyid==2 select cu.name
or
var result = db.companies .join(customers.where(x==>x.companyid==2), x=>x.companyid, y=>y.companyid, y=>y.name);
where companies
, customers
refer companies , customers respectively.
Comments
Post a Comment