Guest User

Untitled

a guest
Jun 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. var p1 = new {Name = "A", Price = 3};
  2.  
  3. class __Anonymous1
  4. {
  5. private string name ;
  6. private int price;
  7. public string Name{ get { return name; } set { name = value ; } }
  8. public int Price{ get { return price; } set { price= value ; } }
  9. }
  10. __Anonymous1 p1 = new __Anonymous1();
  11. p1.Name = "A";
  12. pt.Price =3
  13.  
  14. var p = new {Name = "A", Price = 3};
  15. //Some Code Here
  16. p.Name = "B";
  17. //Some more code
  18. p.Price = 5;
  19.  
  20. var p = new {Name = "A", Price = 3};
  21.  
  22. //Some Time Later
  23.  
  24. var q = new {Name = "B", Price = 4};
  25.  
  26. //Only one anonymous class is generated in the IL
Add Comment
Please, Sign In to add comment