Hello, I believe this is not really a NHibernate specific question, rather a linq to <db or orm> one. As said here on stackoverflow<http://stackoverflow.com/questions/7418624/linq-where-ignore-accentuation-and-case>, you may write an extension to perform this task, but they do not recommend it since this means doing the filtering by code after having loaded all entities. Instead, they recommend to change the collation of your column to be case and/or accent insensitive. ("Collation" may be SQL Server terminology, I do not know if it applies to other db.) Of course, this change will impact any other query against this column, and so it should be done carefully. It may also cause collation mismatch in some clauses (columns concatenations or things like that).
It would be far better to have a way to overload collation only for this specific where clause, but I do not think it is doable with linq-to-somethingh. (It can be done in native transact SQL, and in HQL if you add some custom extension in dialect.) Regards. Le jeudi 29 août 2013 20:18:25 UTC+2, Felipe Oriani a écrit : > > Hello guys, I have a software and my users will use it with portuguese > language. In this language we have accenttuation in some characteres, for > sample: à, á, é, í, ã, etc... > > Is there any way to create a Linq Query to ignore it when I do some > filters? > > session.Query<Customer>().Where(c => c.Name.Contains(?)).ToList(); > > Thank you. > > -- > ______________________________________ > Felipe B Oriani > > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers. For more options, visit https://groups.google.com/groups/opt_out.
