Is a syntax of this kind possible with Aurelius?
The version below does not work with an error
E2531 Method 'Find' requires explicit type argument(s)
function TAureliusService.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.WHERE(TLinq.Eq('ID', aID)).UniqueResult;
if Assigned(aEntity) then
begin
Manager.Remove(aEntity);
Result:= true;
end;
end;
But I would hope it might be possible to dynamically assign the aEntity rather than having to write a separate method for the deletion of every Entity class.