I saw a good looking reply from Wagner for this topic:
https://support.tmssoftware.com/t/question-about-how-to-return-classtype-or-classref/23258/3
And so I marked it solved. Then tried to use the suggested code. It has returned the error:
E2531 Method 'UniqueResult' requires explicit type argument(s)
Here is my code:
function TKKFUPhoneService.DeleteRecord(aID: Integer;
aTableName: String): Boolean;
var
aEntity: TObject;
aClass: TPersistentClass;
begin
Result := false;
aClass:= GetClass('T' + aTableName);
if aClass <> Nil then
aEntity:= Manager.Find(aClass).WHERE(TLinq.Eq('ID', aID)).UniqueResult;
if Assigned(aEntity) then
begin
Manager.Remove(aEntity);
Result:= true;
end;
My intention is to be able to dynamically assign the class of the Aurelius Entity to allow "Remove" to be called against any Entity from a single method call.