Hey guys,
I am currently working on some code for a Plug-In and stumbled upon an issue.
I am retrieving records stored in an N:N relationship table with the help of the "QueryByAttribute" function. Then I store the results (GUIDs) in a DataCollection. Afterwards I retrieve each single record from that DataCollection with some columns I require in a "foreach" loop and add each single record retrieved to an "EntityCollection". Now I would like to sort the records stored in that "EntityCollection" by a DateTime attribute that was part of the ColumnSet.
So basically I got an EntityCollection that got like 10 records, each record got a "DateTime" attribute (column) by which I would like to sort that "EntityCollection".
Or should I maybe create an own class containing 1. an entity method and 2. an integer method and then use that class with "List<T>", add the results into that List instead of the EntityCollection and then sort the records by DateTime in a foreach loop storing the "Order" of the whole list in the integer part of the class? Or am I missing something really simple and obvious?
Does anyone have a quick advice or sample code for such a requirement or anything similar?
Appreciate your help, guys