How to select some nodes and links simultaneously

how to select some nodes and links at same time.
i am using mydiagram.select(nodes) and mydriagram.select(links).
It is selecting links but not nodes as the method select is called at last.

You could either call Diagram.Select on a single collection, or you could set Part.IsSelected to true on each Part.