Case Sensitivity

Nov 26, 2012 at 9:06 AM

Effort appears to treat text in a case sensitive fashion.  so name like '%silly%' does not match 'Silly'.

From what I understand EF will treat comparisons run against the database as case insensitive (assuming the database is set to case insensitive which is the default).

However the same Linq run against in memory objects will be case sensitive.

I'm not entirely sure what should happen in Effort here.  I think for the moment, I will try and make any comparisons case insensitive in the code, but it might be worth thinking about the best way to handle this in Effort (e.g. a constructor setting / parameter which specifies the default collaction.

As a larger question, how should effort handle collations in general?  If one is running against SQL server, the collation will affect both searching and sorting.  Should Effort attempt to emulate this and if so how?  As far as I know there is no way of specifying collation in EF.



Nov 26, 2012 at 9:22 AM

Alternatively, I won't.

It seems non trivial to introduce case insensitivity into an EF Contains operator.  So I will just make sure my unit tests are cased correctly.



Nov 26, 2012 at 11:40 AM
Edited Nov 26, 2012 at 2:54 PM

I think it would not be hard to make the string operations case insensitive. Maybe that should be the default behavior for now. On the other hand, creating a customizable collation system does not seem trivial for me, it would also need serious development on NMemory.

Nov 26, 2012 at 2:49 PM

It would be great to have the DB able to be case insensitive (preferably as the default, since I suppose most people are using SQL Server).

Column specific collation is not something I would expect to happen any time soon.  I think the value is relatively low and the cost of doing so high (less so if EF added a collation attribute to properties).  But I thought I'd put it down in case you have a terribly boring weekend sometime...