0

I'm working on 'NorthWind' database and I want to convert my SQL codes to LinQ.

Here my codes:

select s.CompanyName,o.OrderID, o.Freight 
from Orders as o 
join Shippers as s on o.ShipVia = s.ShipperID

1 Answer 1

2
var query = from o in db.Orders
            join s in db.Shippers on o.ShipVia equals s.ShipperID
            select new {
               o.OrderID,
               o.Freight,
               s.CompanyName
            };

I suggest you to use LINQ Pad for learning LINQ and testing your queries.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.