简单而又难以理解。我只想根据FileCategory过滤器类别名称对网格应用过滤器。假设我想过滤类别名称为Central Supply的项目的网格。这是数据和我的尝试。在我的尝试中,我表明过滤器适用于属性(单个值),但我不能使它适用于集合。
Data: [
-{
Id: 1
FileName: "MyFile"
RevisionDate: "2013-01-08T00:00:00"
FormNumber: "MyFormName"
FormTitle: "aa"
Class: "a"
SecondaryCategory: "a"
UploadDate: "2013-01-11T08:34:46.677"
-FileCategoryFilter: [
-{
FileCategoryId: 1
CategoryName: "Administrative Manual Docs"
Active: true
File: null
}
-{
FileCategoryId: 4
CategoryName: "Central Supply"
Active: true
File: null
}
]
}
.Filter(filters =>
// { filters.Add(p => p.FileName).IsEqualTo("Central Supply");})
//this filter works for a property but I havent figured out how to do a collection.
{
filters.Add(
p =>p.FileCategoryFilter.Select(i=>i.CategoryName).Contains("Central Supply")
);
})