+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / dynamicModuleManager.GetDataItems Where LString value is...

dynamicModuleManager.GetDataItems Where LString value is...

2 posts, 0 answered
  1. Trevor
    Trevor avatar
    35 posts
    Registered:
    28 Jan 2012
    15 Jul 2015
    Link to this post

    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?
  2. Trevor
    Trevor avatar
    35 posts
    Registered:
    28 Jan 2012
    15 Jul 2015
    Link to this post

    Turns out this works:

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

2 posts, 0 answered