Get const from DictionaryGenarator

Is it possible to get fieldnames as consts by using DictionaryGenerator?

As far as I see, the property consts of CodeUnit is not used within TCustomDictionaryGenerator.Generate.
So it looks like, this is not possible yet, am I right?

Maybe you could create Consts like this:

Result right now:

function TEntity.Id: TLinqProjection;
begin
  Result := Prop('Id');
end;

possible unique result:

consts
  csEntityId = 'Id';

function TEntity.Id: TLinqProjection;
begin
  Result := Prop(csEntityId);
end;

combination of Entity-Name and FieldName (or Propertyname) should be unique and give us the possibility to use these const for ColumnAttribute.

If this is not possible yet, please tell me, so that I can add a feature request.

You can use Entity.Id.PropName to get the property name.

I know, but this is not a const, so that it can't be used for Column-Attribute for example.

And PropName is deprecated, so we avoid using it...

Then indeed it will require a significant change in the dictionary generator. It's not currently possible.

feature request DictionaryGenerator: Generate Column-const opened

1 Like

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