The following query works. I get the correct result back when I enter the name with a wrong casing.
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) returns no results. Mark 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?