I have created a case insensitive dictionary in C Sharp as follows . And the following code throws an exception, since the dictionary is case insensitive.
IDictionary<string, ABCentre> names = new Dictionary<string, ABCentre>(StringComparer.OrdinalIgnoreCase);
names.Add("LC001", new ABCentre());
if (names.ContainsKey("lc001"))
{
names.Add("lc001", new ABCentre());// Exception , same key exists
}
But while mapping this dictionary(names) with some aggregation class in NHibernate, i am not able to get this exception. i.e., same text with different cases can be added to the keys .
Does the names dictionary, gets overridden with the one that NHibernate creates dynamically (using reflection), which is case sensitive.
Can some one suggest , how to map a case insensitive dictionary to NHibernate.?
thanks , vijay