More in this section

Forums / Bugs & Issues / Linq bug from PITS

Linq bug from PITS

4 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Mar 2012
    Link to this post
    What's the deal with this bug?

    Linq parser is not working for array of guids field in the Module Builder
    http://www.telerik.com/support/pits.aspx#/details/Issue=10068

    Does this mean we can't use the new Array of Guids column??
  2. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    07 Mar 2012
    Link to this post
    This was an issue I found when trying to use the "Array of Guids" field type. When using the control that Radoslav posted about in the blogs, you can create and array of guids to facilitate a parent/child relationship with other modules. When I was trying to filter out parent items from a child item, I was presented with some OpenAccess linq issues. I was given the following as a workaround:

    var myFilteredCollection = dynamicModuleManager.GetDataItems(testType).ToList().
                    Where(item => item.GetValue<Guid[]>("Locations").Contains(locationID)).ToList();

    This example would follow the PITS code. Basically I know my child ID and I want to find all parents where my child ID resides in the Parent items "Array of Guids" field. In the above case, the field name is Locations.
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    07 Mar 2012
    Link to this post
    Thanks Richard very helpful :)

    So using that snippet all SHOULD be fine then eh?  Have you fully implemented it?
  4. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    07 Mar 2012
    Link to this post
    Yes, I just got a response to my support ticket this morning and have already implemented this and tested. I created a a control based off the FieldListView control to output my related items as links. I have it setup to output the child items on a parent page and the parent items on a child page. I just added the control to the sample project that Radoslav attached to his post. Hopefully I will have the control built out to handle more types of associations. Right now, my use case just needs the ability to show the relationship as links.
4 posts, 0 answered