Inside of Kentico each Class has an Info and InfoProvider class (some also have Helper classes).
The "____Info" (ex CategoryInfo) represents the actual item, and has all of it's properties (ex
The "____InfoProvider" (ex CategoryInfoProvider) has methods that allow you to retrieve your Info objects, as well as other related functions. Most all Providers have a Get_____Info() (ex
CategoryInfoProvider.GetCategoryInfo("TheCodeName")) that allows you to get the Info object by ID, CodeName, or GUID. They also have a Get_____s() (ex
CategoryInfoProvider.GetCategories()) which is a Queriable object.
So in your case, you want to do something along the lines of:
var MyCategories = CategoryInfoProvider.GetCategories().Where("Some Where Condition").OrderBy("CategoryDisplayName");
You can also create your own Classes using modules, and generate the Info and InfoProvider classes for those, but that is probably not needed here. Hope that helps educate you!