I have the following:
var nodes = _nodeService.GetNodeChildren(id, nId);
var association = _nodeService.GetNodeOrder(id, nId);
var joinedNodes = nodes.Join(association,
n => n.Id,
a => a,
(n, a) => new {nodes = n, association = a};
var enumerable = joinedNodes.ToList();
var orderedNodes = enumerable.OrderBy(x => x.association);
return orderedNodes.nodes;
where nodes is a list of objects and association is a list of GUIDs.
Issue is I'm not getting the order back as i expected.
I need to return a list of nodes based in the order that the GUIDS positions are.
the following is part of the test code
_ngOrder = new List<Guid>
{
_nodeId2,
_nodeId1,
_nodeId4,
_nodeId3,
}
_nodeClient.SetNodeOrder(_ngOrder);
When i get the method and assert here is the code:
Assert.That(_response[0].Id, Is.EqualTo(_node2Id);
Assert.That(_response[1].Id, Is.EqualTo(_node1Id);
Assert.That(_response[2].Id, Is.EqualTo(_node4Id);
Assert.That(_response[3].Id, Is.EqualTo(_node3Id);