2

I am curious to know how to convert LINQ query to lambda so I visited the below link and follow the same but my linq query could not convert to lamda automatically.

convert this LINQ expression into Lambda enter image description here

This is my LINQ pad image where I use C# program:

enter image description here

Can anyone guide me what I am doing for which linq pad not being able to convert my linq to lambda?

Community
  • 1
  • 1
Mou
  • 15,673
  • 43
  • 156
  • 275

2 Answers2

2

You're not in "C# Expression" mode. Copy and paste just the LINQ part (from x in y...) to a new tab (make sure C# Expression is selected from the droplist) and then try converting to lambda. Repeat for other LINQ query.

Gerino
  • 1,943
  • 1
  • 16
  • 21
  • can u show me with picture. when i try a sample in C# expression mode then encounter error but when i test the same with C# statement then my program execute but lamda did not come. – Mou Jun 17 '15 at 09:10
1

i found out how to do it. here is the screen shot.

Writing the Query expression directly without .ToList(), .FirstOrDefault(), SingleOrDefault() will show the coresponding Lambda Expression in Lambda ExpressionTab.

enter image description here

sudhansu63
  • 6,025
  • 4
  • 39
  • 52
Mou
  • 15,673
  • 43
  • 156
  • 275