Given I have a list of objects.
These objects have a property if ID
So var obj = new Object();
obj.ID = 1;
Now these objects have preceding objects, the preceding objects are linked by ID
Like this:
var obj1 = new Object();
var obj2 = new Object();
var obj3 = new Object();
var obj4 = new Object();
var obj5 = new Object();
obj5.precedingObjectId = obj4.Id;
obj4.precedingObjectId = obj3.Id;
obj3.precedingObjectId = obj2.Id;
obj2.precedingObjectId = obj1.Id;
As you can see, each object is linked to the object before it. object2 has a preceding object of object1.
The object names named incrementally is so just for purposes of explanation so i can not order by name.
Now I have a list of these objects jumbled up. So I need to order by preceding object. If object2 has a preceding object of object1 then object1 should come before object2 in the List
Is there a way to do this?