如何OrderBy(a=>a.SortField)
通过“SortField”对以下查询结果进行添加或排序
var slideShowProducts = _contentManager.Query<JewelleryProductPart, JewelleryProductPartRecord>("JewelleryProduct")
.Join<CustomPropertiesPartRecord>()
.Where(cpp => cpp.CustomOne == catViewModel.Number)
.Join<BodyPartRecord>()
.List()
.Select(sp => new SlideShowProductViewModel
{
Count = sp.Count,
CategoryName = sp.Fields.Single(f => f.PartFieldDefinition.Name == "Category").Storage.Get<string>(""),
SortField = sp.Fields.Single(f => f.PartFieldDefinition.Name == "Sort Field").Storage.Get<string>(""),
Description = sp.Get<BodyPart>().Text
}).ToList();
SlideShowProductsViewModel products = new SlideShowProductsViewModel();
products.Number = catViewModel.Number;
products.CategoryName = catViewModel.Name;
products.SlideShowProducts = slideShowProducts;
productList.Add(products);