Retrieving Generic List Items
Hi,
I have created a new "List" (Content > Lists) named "Quotes", into which I have published two List Items.
I am trying to retrieve the list as follows:
var quotesContent = App.WorkWith().Lists().Where(itm => itm.Title =
"Quotes"
&& itm.Status == ContentLifecycleStatus.Live).Get().SingleOrDefault();
OK, I thought this was being caused because I was using the assignment operator, not the equality!
I corrected it to read:
var quotesContent = App.WorkWith().Lists().Where(itm => itm.Title ==
"Quotes"
&& itm.Status == ContentLifecycleStatus.Live).Get().SingleOrDefault();
var quotesContent = App.WorkWith().Lists().Where(itm => itm.Title ==
"Quotes"
).Get().SingleOrDefault();
Hello Paul,
The query will always return null, as the List itself does not have Content LifeCycle implemented, its list items do, that's why removing the filter returns the proper content (you'll notice the same behavior for Blogs, for example). As you can observe, a List can only be created and deleted, it does not go through Master->Draft->Live statuses. For more information, please consult our Lists API.
All the best,
Boyan Barnev
the Telerik team