Hello,
i have a strange Problem and can't find anything on the internet and in this forum about it.
My Select is pretty easy. All i want is a query with an orderby name, which is case insensitive. Like "Select * from tbl order by UPPER(column);"
My first guess was this, but i alwas get an
IndexOutOfBounds ExceptionCode:
var query = from o
in session.Linq<OrganisationalUnit>()
orderby o.Name.ToUpper()
select o;
retun query.ToList();
The second try was
Code:
var query = from o
in session.Linq<OrganisationalUnit>()
select o;
return query.OrderBy(p => p.Name, StringComparer.CurrentCultureIgnoreCase).ToList();
Again an exception.
This would work. But there has to be a better way:
Code:
var query = from o
in session.Linq<OrganisationalUnit>()
select o;
return query.ToList().OrderBy(p => p.Name, StringComparer.CurrentCultureIgnoreCase).ToList();
Or is there a complete different way to do an select which is case insensitive, and I'm completely wrong? Thank you for your help.
Regards,
MoJo