0

How to convert Ruby Hash to C# Dictionary?

Do we have any built-in function...or something?

SomeGuyWhoCodes
  • 579
  • 6
  • 19

1 Answers1

0

The .Net Dictionary type is a generic type which need special treatment in Ironruby. By my knowledge you cannot cast a hash to a dictionary in ironruby. But it should not be hard to write a helper function that does the conversion for you. You may even open up the hash class in ruby and include the helper inside the hash so you can return a dictionary.

See the link below how this is done in C#.

convert HashTable to Dictionary in C#

Community
  • 1
  • 1
Der Buhlert
  • 116
  • 5