Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var p1 = new {Name = "A", Price = 3};
- class __Anonymous1
- {
- private string name ;
- private int price;
- public string Name{ get { return name; } set { name = value ; } }
- public int Price{ get { return price; } set { price= value ; } }
- }
- __Anonymous1 p1 = new __Anonymous1();
- p1.Name = "A";
- pt.Price =3
- var p = new {Name = "A", Price = 3};
- //Some Code Here
- p.Name = "B";
- //Some more code
- p.Price = 5;
- var p = new {Name = "A", Price = 3};
- //Some Time Later
- var q = new {Name = "B", Price = 4};
- //Only one anonymous class is generated in the IL
Add Comment
Please, Sign In to add comment