.net - OrderedDictionary 的替代或解决方法以避免重复键错误
问题描述
我正在使用一个函数来返回 OrderedDictionary 并填充 pdf 的一部分,但我需要包含重复的键,因为它们是标签文本。有没有办法掩盖受骗者或更好的方法来做到这一点,而不是对受骗者挑剔?
Private Shared Async Function GetSiteSpecificStaging(MDTID As String, Optional cSite As String = Nothing) As Task(Of OrderedDictionary(Of String, String))
Using con = New SqlConnection(ConnectionString),
com = con.CreateCommand
com.CommandType = CommandType.StoredProcedure
com.CommandText = "GetPrintStagingData"
com.CommandTimeout = 600
con.Open()
com.Parameters.AddWithValue("@MDTID", MDTID)
Using r = Await com.ExecuteReaderAsync().ConfigureAwait(False)
If r.Read Then
Return New OrderedDictionary(Of String, String) From {
{"Reported Date", r("StageReportDate1").ToString.NullIfNotDate?.ToShortDateString},
{"Reporting Organisation", r("StageReportOrg1").ToString},
{"Chang Stage", r("Chang").ToString},
{"INRG Staging System", r("INRG_DESC").ToString},
{"Biopsy Gleason", FormatGleason(r("BiopsyGleason1").ToString, r("BiopsyGleason2").ToString)},
{"Reported Date", r("StageReportDate2").ToString},
{"Reporting Organisation", r("StageReportOrg2").ToString}
}
Else
Return New OrderedDictionary(Of String, String)
End If
End Using
End Using
End Function
解决方案
推荐阅读
- xml - xml中枚举值的自定义排序
- c++ - C++ FTraceDatum 从来没有命中
- java - 将 .arff 文件上传到 Eclipse
- amazon-web-services - AWS Glue 作业参数“MaxConcurrentRuns”如何与 StepFunction 的并发执行相关联
- jenkins - 在 Jenkins/Selenium Grid 中按顺序运行多个 Testcafé 测试
- php - 用另一个对象的公共变量初始化一个对象
- android - 如何使半视图不可点击
- visual-c++ - 将带有数组的结构作为参数传递给 C++ dll 问题中的函数
- youtube-data-api - YouTube 数据 API 未返回完整数据集
- mysql - 如何解决mysql代码中的WITH语法错误