Linq bug from PITS

Posted by Community Admin on 04-Aug-2018 14:47

Linq bug from PITS

All Replies

Posted by Community Admin on 07-Mar-2012 00:00

What's the deal with this bug?

Linq parser is not working for array of guids field in the Module Builder
www.telerik.com/.../pits.aspx

Does this mean we can't use the new Array of Guids column??

Posted by Community Admin on 07-Mar-2012 00:00

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.

Posted by Community Admin on 07-Mar-2012 00:00

Thanks Richard very helpful :)

So using that snippet all SHOULD be fine then eh?  Have you fully implemented it?

Posted by Community Admin on 07-Mar-2012 00:00

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.

This thread is closed