在Orchard模块的开发中,如何检索按字段不区分大小写过滤的ContentParts?我努力了
var name = viewModel.Name.ToUpper();
var samples = _contentManager.Query<SamplePart, SamplePartRecord>()
.Where(x => x.Name.ToUpper() == name)
.List();
我得到一个错误
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
但是当我试图检索而不用担心它是否区分大小写时
var name = viewModel.Name;
var samples = _contentManager.Query<SamplePart, SamplePartRecord>()
.Where(x => x.Name == name)
.List();
没有报告错误。
是什么赋予了?