ToLower and ToUpper inverted in Linq?

252 views
Skip to first unread message

Diego Mijelshon

unread,
Apr 8, 2010, 10:17:09 AM4/8/10
to nhibernate-development
These lines from NHibernate.Linq.Functions.StringGenerator caught my attention today while researching http://stackoverflow.com/questions/2598202/does-nhibernate-linq-support-tolower-in-where-clauses:

                if (((method.Name == "ToUpper") || (method.Name == "ToUpperInvariant")))
                {
                    methodName = "lower";
                }
                else
                {
                    methodName = "upper";
                }

Isn't it supposed to be the other way around?

   Diego

Richard Brown

unread,
Apr 9, 2010, 2:35:17 AM4/9/10
to nhibernate-...@googlegroups.com
It does look a little suspicious.  Shouldn't be hard to create a failing test?

Diego Mijelshon

unread,
Apr 9, 2010, 10:50:54 AM4/9/10
to nhibernate-...@googlegroups.com
Done, test case and patch created: http://216.121.112.228/browse/NH-2169

   Diego
Reply all
Reply to author
Forward
0 new messages