The following query is executed. I get the correct result when I enter the name with the wrong case.
private static IObjectContainer db = Db4oFactory.OpenFile(db4oPath);
public static IQueryable<Company> GetCompaniesByName(string name) {
return (from Company c in db
where c.Name.ToLowerInvariant().Equals(name.ToLowerInvariant())
select c).AsQueryable();
}
The following query with the same parameter (basically the same unit test) does not return results. Note that the only difference is the where clause.
public static IQueryable<Company> GetCompaniesByName(string name) {
return (from Company c in db
where c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)
select c).AsQueryable();
}
Why?
source
share