c# - Linq spit numeric list in search (kentico) -
in kentico standard way documents in below (which believe based on objectquery , has linq commands). im trying filter 1 more field "newscategory" contains data "1|2|3". cant add .search("newscategory", 1) etc because need split list before can search it. direction should looking? select sub-query? (im new linq)
// documents var news = documenthelper.getdocuments("cms.news") .onsite("corporatesite") .path("/news", pathtypeenum.children) .culture("en-us") .combinewithdefaultculture(false);
as far field coupled table, can't access through property, have use getvalue()
instead. once you've got, can work regular string:
var news = documenthelper.getdocuments("cms.news") .onsite("corporatesite") .path("/news", pathtypeenum.children) .culture("en-us") .combinewithdefaultculture(false) .where(d => d.getstringvalue("newscategory","").split('|').contains("1"));
Comments
Post a Comment