Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can I write the following code at single select statement?
Category model = new Category(); model.articles = new List<Article>(); List<Article> articleList = new List<Article>(); Article article = new Article(); var childs = CurrentPage.Children; foreach (var content in childs) { article = new Article(); article = getArticle(content); articleList.Add(article); } var posts = CurrentPage.AncestorOrSelf(1).DescendantsOrSelf() .Where(x => x.HasProperty("relatedContentItem")).ToList(); foreach (var content in posts) { ArchetypeModel fieldsetlist = content.GetPropertyValue<ArchetypeModel>("relatedContentItem"); foreach (ArchetypeFieldsetModel fieldset in fieldsetlist) { if (fieldset.GetValue<IPublishedContent>("article") != null && fieldset.GetValue<IPublishedContent>("article").Equals(CurrentPage)) { article = new Article(); article = getArticle(content); articleList.Add(article); } } } model.articles = articleList.OrderByDescending(x => x.PublishedDate).ToList();
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Select content by property value ?
How can I write the following code at single select statement?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.