Something like this has worked for me:
TaxonomySession taxSession = new TaxonomySession(rootSite);
TermStore termStore = taxSession.TermStores.DefaultIfEmpty(null).FirstOrDefault(x => x.Name == managedMetadataServiceName);
Group termGroup = termStore.Groups.DefaultIfEmpty(null).FirstOrDefault(x => x.Name == managedMetadataGroupName);
TermSet termSet = termGroup.TermSets.DefaultIfEmpty(null).FirstOrDefault(x => x.Name == managedMetadataTermSetName);
...and then you can iterate through the termset using Linq if you want with the criteria you have. For instance (this is untested code so bear with me; the pseudo-code is really what you should be interested in):
List<Term> termList = termSet.FindAll(x => x.LocalCustomProperties["ID"] == "12" && x.LocalCustomProperties["Model"] == "S600");
A couple things to note:
- The LocalCustomProperties bag stores everything as a string, so if you want to do numerical work with them, you have to convert them first.
- If you've set up a term hierarchy within the termset (for instance, you have 25 items under Nissan and 40 under Honda), you'd need to set up a function to run that last statement recursively to build the list.