Skip to main content
added 10 characters in body
Source Link
Paul Fleming
  • 24.6k
  • 8
  • 79
  • 113

To make it more readable and maintainable, you can also split it up into multiple LINQ statements.

  1. First, select your data into a new list, let's call it x1x1, do a projection if desired
  2. Next, create a distinct list, from x1x1 into x2x2, using whatever distinction you require
  3. Finally, create an ordered list, from x2x2 into x3x3, sorting by whatever you desire

To make it more readable and maintainable, you can also split it up into multiple LINQ statements.

  1. First, select your data into a new list, let's call it x1, do a projection if desired
  2. Next, create a distinct list, from x1 into x2, using whatever distinction you require
  3. Finally, create an ordered list, from x2 into x3, sorting by whatever you desire

To make it more readable and maintainable, you can also split it up into multiple LINQ statements.

  1. First, select your data into a new list, let's call it x1, do a projection if desired
  2. Next, create a distinct list, from x1 into x2, using whatever distinction you require
  3. Finally, create an ordered list, from x2 into x3, sorting by whatever you desire
Source Link
a7drew
  • 7.8k
  • 6
  • 40
  • 39

To make it more readable and maintainable, you can also split it up into multiple LINQ statements.

  1. First, select your data into a new list, let's call it x1, do a projection if desired
  2. Next, create a distinct list, from x1 into x2, using whatever distinction you require
  3. Finally, create an ordered list, from x2 into x3, sorting by whatever you desire