Sitefinity CMS supports dynamic LINQ queries that can execute lambda expressions defined in a string against an IQueryable collection. This article demonstrated how to filter monolingual and multilingual pages using two different methods: pages.Where() and DataProviderBase.SetExpressions().
To filter a collection of pages by their title, perform the following:
To filter pages with the pages.Where() method, use the following code snippet:
NOTE: To execute dynamic LINQ queries, in your code, you must add using Telerik.Sitefinity.Data.Linq.Dynamic;
If you have multilingual pages, to ensure the filter you pass is executed against the Lstring value for the correct culture you can use the following code sample:
CultureRegion
To filter multilingual pages with the pages.Where() method, use the following code snippet:
To filter pages with the DataProviderBase.SetExpressions() method, use the following code snippet:
NOTE: To use the DataProviderBase class, in your code, you must add using Telerik.Sitefinity.Data;
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important