public Articles GetByName(string name, Categories category, Companies company)
{
var query = from article in session.Linq<Articles>()
where article.Name == name &&
article.Category == category &&
article.Company == company
select article;
return query.FirstOrDefault();
}
查询如何不区分大小写。我可以使用 toLower 或 toUpper,但我想使用 OrdinalIgnoreCase。可能吗?
最佳答案
使用带有适当参数的 String.Equals
使其不区分大小写
mySource.Where(s => String.Equals(s, "Foo", StringComparison.CurrentCultureIgnoreCase));
关于c# - linq 不区分大小写(没有 toUpper 或 toLower),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5312585/