我正在摸不着头脑,因为我无法理解为什么会发生以下情况:
'//VB.NET
Dim product1 = New With {.Name = "paperclips", .Price = 1.29}
Dim product2 = New With {.Name = "paperclips", .Price = 1.29}
'compare product1 and product2 and you get false returned.
Dim product3 = New With {Key .Name = "paperclips", Key .Price = 1.29}
Dim product4 = New With {Key .Name = "paperclips", Key .Price = 1.29}
'compare product3 and product4 and you get true returned.
'//C#
var product5 = new {Name = "paperclips", Price = 1.29};
var …Run Code Online (Sandbox Code Playgroud)