F# map to C# Dictionary

后端 未结 3 1570
臣服心动
臣服心动 2020-12-29 04:14

I\'m trying to convert an F# map to a C# dictionary, so far I am using:

    let toDictionary (map : Map<_, _>) : Dictionary<_, _> =
        let d         


        
3条回答
  •  生来不讨喜
    2020-12-29 05:08

    A C# Dictionary will take an IDictionary in it's constructor. Map is an IDictionary so:

    let toDictionary (map : Map<_, _>) : Dictionary<_, _> = Dictionary(map)
    

提交回复
热议问题