NewsItem Query
Why would this:
var rotatorCategory =
new
Guid(
"8C4DACE0-7867-40E5-B261-E963AB672E4B"
);
var content = App.WorkWith().NewsItems()
.Publihed()
.Where(ci => ci.GetValue<IList>(
"Category"
).Contains(rotatorCategory))
.Get();
rotator.DataSource = content.ToList();
rotator.DataBind();
Line 19: .Where(ci => ((IList<Guid>)ci.GetValue("Category")).Contains(rotatorCategory));
Line 20:
Line 21: rotator.DataSource = content;
Line 22: rotator.DataBind();
Line 23:
|
Hello Steve,
Categories are stored in the form of a list of Guids. This means that when you access them you should use:
.Where(ci => ci.GetValue<
IList
<Guid>>("Category").Contains(rotatorCategory)
).Get();
This is returning strange results....
I only have 2 news items in this category, but its giving me 4 items back, one is duplicated, the other is blank???
www.screencast.com/.../gasSIJmG
Hi Steve,
Get the items where c.Status == ContentLifecycleStatus.Live
Regards,
Ivan Dimitrov
the Telerik team