dynamicModuleManager.GetDataItems Where LString value is...

Posted by Community Admin on 04-Aug-2018 02:09

dynamicModuleManager.GetDataItems Where LString value is...

All Replies

Posted by Community Admin on 15-Jul-2015 00:00

When I'm getting a string value from a dynamic content type in SF 8, I can use the following line:

item.ItemDefaultUrl.GetString(new CultureInfo("en"), false);

 However, I can't use the same snipped in the "Where" clause of the DynamicModuleManager.GetDataItems() function:

dynamicModuleManager.GetDataItems(careerType)
               .Where(
                   i =>
                       i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live
                       && i.Visible == true
                       && i.ItemDefaultUrl.GetString(new CultureInfo("en"), false) == "/"+actionName
               ).First();

The latter snipped yields this message:

Method 'GetString' is not supported on the 'Telerik.Sitefinity.Model.Lstring' type.​

What can I do to filter the results of GetDataItems by the LString type?

Posted by Community Admin on 15-Jul-2015 00:00

Turns out this works:

dynamicModuleManager.GetDataItems(careerType)
               .Where(
                   i =>
                       i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live
                       && i.Visible == true
                       && i.ItemDefaultUrl == "/"+actionName
               ).First();

This thread is closed