Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initialize Dictionary in .Net 2.0

Is there a simple way to initialize a dictionary that is a property like in .Net 3.5 or do I need to add the elements in the class's constructor?

My aim is to have a static map of codes mapping to string representation.

like image 743
Shaihi Avatar asked Oct 12 '25 08:10

Shaihi


1 Answers

Yes, you'll need to initialize your Dictionary at class constructor.

like image 58
Rubens Farias Avatar answered Oct 13 '25 21:10

Rubens Farias



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!