Query Images Excluding Recycle Bin

Posted by Community Admin on 04-Aug-2018 13:56

Query Images Excluding Recycle Bin

All Replies

Posted by Community Admin on 05-Jun-2015 00:00

What is the official recommended way to do this?  The following code below generates an exception.

Exception for code below: 

Identifier 'IsDeleted' is not a parameter or variable or field of 'Telerik.Sitefinity.Libraries.Model.Image'. If 'IsDeleted' is a property please add the FieldAlias or Storage attribute to it or declare it as a field's alias.

model.Images = App.WorkWith().Images().Get().Where(i => i.Parent.Title == Library
 && i.Status == ContentLifecycleStatus.Live
 && i.IsDeleted == false);


 

I tried using "IsDeleted" with the via the native query approach with the same exception.  The following code works. 

album.Images().Where(i => i.Status == ContentLifecycleStatus.Live && i.Visible == true);

 

 

 

Posted by Community Admin on 10-Jun-2015 00:00

Hello Stacey,

You have to filter by Visible property in order to get only published items. Please check the following forum thread where this is explained in details.

Get Published Items Only

Regards,
Kaloyan
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed