Hello I'm not clear why my linq statement orderby
is not working as expected.
var q = from DirectoryInfo subDirectory
in item.GetDirectories()
orderby (item.Name == "TableDefinition" ? 1 : 2), item.Name
select subDirectory;
foreach (DirectoryInfo subDirectory in q)
{
Execute(subDirectory);
}
I want the items sorted first by seeing if the name is "TableDefinition" or not, then secondly just by name.
It appears that it's just sorting by name only, in alpha order ascending.