|
Rank: Administration Groups: Administrators, Registered
Joined: 9/3/2009(UTC) Posts: 1,555 Location: Xiamen China
|
The document will be coming soon. Yes, that code almost can get all the comments for the article, but the correct C# code will be: Code:
var children = ((Kooboo.CMS.Content.Model.TextContent)ViewBag.Article).Children(commentSchema);
// Then you can also continuing add some filters on children queryable. For example:
children = children.WhereEquals("Published",true);
// If you are familiar with C#, you will find it is similar to LINQ.
// It is also easy to get all comments for all articles. There are two ways:
1. var allComments = commentSchema.CreateQuery();
2. var allArticleComments = articleFolder.CreateQuery().Children(commentSchema);
// As you see, get all comments for all articles, you just only remove that all filters.
Regards, Jifeng Huang
Kooboo Team
Microsoft ASP.NET MVP
|