Dennis Lukas
Dennis Lukas

Reputation: 593

Converting a Linq statement in VB to C#

I have the following line in VB

Dim Totalstock = (From stock In StockInfo.Record, locs In Location.BranchList Where locs.Key.Item1 = "Deliver" And locs.Key.Item2 = stock.WHLO Select stock).ToArray

which i need to translate to C#. I am used to using the lambda statements in Linq, but with this query I have no idea how to convert it.

Perhaps anyone who could help me out?

Upvotes: 0

Views: 74

Answers (1)

Seabizkit
Seabizkit

Reputation: 2415

var Totalstock = (
    from stock in StockInfo.Record
    from locs in Location.BranchList
    where locs.Key.Item1 == "Deliver" && locs.Key.Item2 == stock.WHLO
    select stock).ToArray();

Upvotes: 2

Related Questions