Skip to main content
formatting
Source Link
w.b
  • 11.2k
  • 5
  • 31
  • 49

I've come across this linq query and just want to ask whatWhat would be the proper way to write itthis query with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;

I've come across this linq query and just want to ask what would be the proper way to write it with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;

What would be the proper way to write this query with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;
formatting
Source Link
w.b
  • 11.2k
  • 5
  • 31
  • 49

I've come across this LINQlinq query and just have a question howwant to ask what would it be writtenthe proper way to write it with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;

I've come across this LINQ query and just have a question how would it be written with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;

I've come across this linq query and just want to ask what would be the proper way to write it with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;
Source Link
w.b
  • 11.2k
  • 5
  • 31
  • 49

LINQ query in lambda syntax

I've come across this LINQ query and just have a question how would it be written with lambda syntax?

var palindromes = from i in Enumerable.Range(100, 9900)
                  from j in Enumerable.Range(100, 9900)
                  let product = (i * j)
                  where product.ToString() == new string(product.ToString().Reverse().ToArray())
                  orderby product
                  select product;