fork download
  1. using static System.Console;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Program {
  6. public static void Main(string[] args) {
  7. var vaos = new List<Vao> {new Vao {Quantidade = 2, Medida = 2}, new Vao {Quantidade = 0, Medida = 0}, new Vao {Quantidade = 1, Medida = 1}};
  8. var ordenada = vaos.OrderBy(p => p.Medida).Select(item => item.Clone()).ToList();
  9. ordenada[1].Medida = 5;
  10. foreach (var item in ordenada) WriteLine($"{item.Quantidade} x {item.Medida}");
  11. foreach (var item in vaos) WriteLine($"{item.Quantidade} x {item.Medida}");
  12. }
  13. }
  14.  
  15. public class Vao {
  16. public int Quantidade { get; set; }
  17. public double Medida { get; set; }
  18. public Vao Clone() => (Vao)this.MemberwiseClone();
  19. }
  20.  
  21. //https://pt.stackoverflow.com/q/171836/101
Success #stdin #stdout 0.03s 18152KB
stdin
Standard input is empty
stdout
0 x 0
1 x 5
2 x 2
2 x 2
0 x 0
1 x 1