imports System.Collections.Generic
dim objList = new List(of obj)
objList.Add(new obj(1, false, "somthing 1"))
objList.Add(new obj(2, false, "somthing 2"))
objList.Add(new obj(3, true, "somthing 3"))
objList = OrderObjs(objList)
for each ob as obj in objList
console.WriteLine("Id:{0} Primary:{1} Data2:{2}", ob.id, if(ob.isPrimary, "Y", "N"), ob.data2)
public function OrderObjs(byref objs as List(of obj)) as List(of Obj)
return objs.OrderByDescending(function(x) x.isPrimary).ThenBy(function(x) x.id).ToList()
public isPrimary as boolean
sub new(id as integer, isprimary as boolean, data2 as string)