Need help with a simple module filter query

Posted by Community Admin on 04-Aug-2018 19:06

Need help with a simple module filter query

All Replies

Posted by Community Admin on 09-May-2012 00:00

The following code was generated by Sitefinity.

Question 1: How should the Where clause be written if the the value "Some UrlName" is stored in a variable called urlName?

var myFilteredCollection = dynamicModuleManager.GetDataItems(myTestModuleType).Where("UrlName = \"Some UrlName\"");

QUestion 2: How should the Where clause be written if there are 2 condititions, such as "UrlName ="  & urlName & " And  SIteName =" & siteName

Posted by Community Admin on 09-May-2012 00:00

Hello David,

Here is a sample:

var myFilteredCollection = dynamicModuleManager.GetDataItems(myTestModuleType).Where( i=> i.GetValue<string>("UrlName") == urlName && i.GetValue<string>("SiteName") == siteName);


Kind regards,
Dimitar Dimitrov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

This thread is closed