【发布时间】:2022-01-22 22:20:27
【问题描述】:
我配置了一个数据模型
Public Partial Class card
<JsonProperty("faction")>
Public Property Faction As Exile
<JsonProperty("id")>
Public Property Id As String
<JsonProperty("image")>
Public Property Image As String
<JsonProperty("import_id")>
Public Property ImportId As String
<JsonProperty("kredits")>
Public Property Kredits As Long
<JsonProperty("rarity")>
Public Property Rarity As Rarity
<JsonProperty("set")>
Public Property [Set] As [Set]
<JsonProperty("text")>
Public Property Text As Dictionary(Of String, String)
<JsonProperty("title")>
Public Property Title As Dictionary(Of String, String)
<JsonProperty("type")>
Public Property Type As TypeEnum
<JsonProperty("can_create", NullValueHandling:=NullValueHandling.Ignore)>
Public Property CanCreate As String()
<JsonProperty("exile", NullValueHandling:=NullValueHandling.Ignore)>
Public Property Exile As Exile?
<JsonProperty("attack", NullValueHandling:=NullValueHandling.Ignore)>
Public Property Attack As Long?
<JsonProperty("defense", NullValueHandling:=NullValueHandling.Ignore)>
Public Property Defense As Long?
<JsonProperty("operationCost", NullValueHandling:=NullValueHandling.Ignore)>
Public Property OperationCost As Long?
<JsonProperty("attributes", NullValueHandling:=NullValueHandling.Ignore)>
Public Property Attributes As Attribute()
End Class
我希望提取 Title 字典中的所有值,所以基本上我将完整的键值对列在与对象本身不同的字典列表中。
我想我可以通过整个对象 For Each 并将它们添加到一个新的字典列表中,但是必须有一个更清洁/更快的方法来执行此操作?
【问题讨论】:
标签: vb.net dictionary