Convert Generic Dictionary to different type

后端 未结 4 510
無奈伤痛
無奈伤痛 2021-01-17 13:02

Is there a quick way to convert a Generic Dictionary from one type to another

I have this

IDictionary _commands;
4条回答
  •  长发绾君心
    2021-01-17 13:51

    Can't you use

    Dim myDictionary AS New Dictionary(Of Object, Object)
    

    This would then be able to accept any types

提交回复
热议问题