You are not logged in.
Pages: 1
I try to convert the "mormotDDD" unit to be used by mORMot2 because I like to use "CQRS" the way it is used in the old mormot DDD-example.
It seemed to be an easy task from the beginning but I'm stopped by a few things.
The TClassInstance is not available in mORMot2. It look like "TRttiClass" could be used here but it is not defined the same.
The " property Aggregate: TClass read fAggregate.rttiClass ;" does not work as rttiClass is a function and not a field.
There are a few more things to fix but I think this is the most important to fix. The other may be solved easier when this is solved. Otherwise I'll come back and ask for more help.
Delphi-11, WIN10
Offline
It is not the same: TRttiClass is just a wrapper around the RTTI of a class - as its name actually suggests.
In mORMot 2, I guess the way to deal with these classes runtime creation is to use TRttiCustom e.g. from Rtti.RegisterClass().
Then you can just call TRttiCustom.ClassNewInstance to allocate a new class instance of the class.
Offline
Pages: 1