2

Is there a way create a dictionary in spring.net which case insensitive?

<dictionary key-type="string" value-type="string">
<entry key="abc">
<ref object="test"/>
</entry>
</dictionary>

Is there any way I can say that the dictionary key can be case insensitive. so that when I search for abc or ABC or Abc I will get the value of test?

Thanks

Added more entry

<object id="Test" type="string">
          <property name="Process">
<object id="ProcessDictionary" type="System.Collections.Generic.Dictionary&lt;string, string&gt;, mscorlib">
                       <constructor-arg>
                              <dictionary key-type="string" value-type="string">
      <entry key="abc">
                                            <ref object="test"/>
                                     </entry>
                              </dictionary>
                       </constructor-arg>
                 </object>
          </property>
</object>

How do I add constructor parameter to ignore case sensitiveness ?

Karun
  • 243
  • 1
  • 9
  • 1
    Not sure what is special with spring.net. I have no idea. But in general you do it [like this](http://stackoverflow.com/questions/19609410/case-insensitive-string-for-use-in-dictionary) – Sriram Sakthivel Aug 12 '14 at 12:44
  • Idea in the link will work if I instantiate the object myself, in this case spring.net will do that for me, so I'm trying to figure out how to set spring to use string.ignoreculturevariant flag during the object creation process – Karun Aug 12 '14 at 12:47
  • strange... I saw some one else posting a comment before mine and I dont see it now.. – Karun Aug 12 '14 at 12:49
  • Nothing strange, he might have deleted the comment :) – Sriram Sakthivel Aug 12 '14 at 12:50
  • That was me. But it was irrelevant due to Sriram's comment, so I removed it. Take a look here how to pass constructor arguments to spring.net: http://stackoverflow.com/questions/7370823/spring-net-inject-dictionary-order-question. – Patrick Hofman Aug 12 '14 at 12:50
  • Updated the question, I still could not figure out how to add constructor parameter to ignore case sensitivity – Karun Aug 12 '14 at 13:17

1 Answers1

0

After trying various spring configuration to make it working, finally I gave up and ended up using a private dictionary variable in the code and handled it through the private dictionary. I wish I could have found a way with spring itself

Karun
  • 243
  • 1
  • 9