Dictionary purpose


Datamodeler 'Export TMS Aurelius Classes' has an option to 'generate Dictionary'

These Dictionaries have classes with Fields type TDictionaryAttribute

What are ther purpose/use cases for those Dictionaries/TDictionaryAttribute properties?

An exemple would be nice. 


Hi Anderson,

The dictionary in the end is just a bunch of string constants so instead of building a query like this:

Manager.Find<TCustomer>.Where(Linq[‘Name’] = ‘Wagner’)

you do something like this:

Manager.Find<TCustomer>.Where(Linq[Dic.Customer.Name] = ‘Wagner’)

The only purpose is to avoid wrong typing of property names so you have errors at compile time instead of runtime. 

Got it. Thanks Wagner! Very nice.

BTW, 'Name' is defined as TDictionaryProperty. So one must use:


An implicit operator in the TDictionaryProperty record would solve this

class operator Implicit(AAttribbute: TDictionaryAttribute): string;

Thanks again. Regards

I meant TDictionaryAttribute.

Yes, we actually have plans to do a revamp of dictionary, it was created before TLinqExpression and record operations were created. A new dictionary will make query building much easier. 

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.