REST-Debugger said:
{ "error": {
"code": "InvalidPointer",
"message": "Ungültige Zeigeroperation"
}}
I don't find the error.
Service-Function (Implementation-Unit)
type
[ServiceImplementation]
TPersonFunc = class(TInterfacedObject, IsngFunc, IPersonFunc)
strict private
function SearchCount ( const Param: TJSONObject) : TJSONObject;
function Search ( const Param: TJSONObject) : TList<TPerson>;
end;
implementation
function TPersonFunc.Search( const Param: TJSONObject): TList<TPerson>;
begin
Result := UnitXY.Search( Filter_is_string)
end;
Then, the UnitXY
function Search(AFilter: String): TList<TPerson>;
var
LSession: IDBSession;
Criteria: TCriteria<TPerson>;
Filter: TCustomCriterion;
begin
LSession := TDBSession.Create( DBConnection);
Criteria := LSession.objManager.Find<TPerson>;
Criteria.Add( (Linq.Contains( 'Number', AFilter)) or
(Linq.Contains( 'Lastname', AFilter)) or
(Linq.Contains( 'Firstname', AFilter)) );
Result := Criteria.List;
end;
I have removed unnecessary code. Usually the AFilter is assembled.
Therefore I don't use Fluent Design.
The error occurs after the last "end" in my programming. I see the error in the REST-Debugger.
If I debug the code, I see the position.
My result list has 8 objects.
In Unit Bcl.Json.ListConverter
In procedure TJsonValueListConverter.WriteJson(const Writer: TJsonWriter; const Value: TValue);
In line 119: ==> Item := List.GetItem(I);
the error happens on the 4. run. The first 3 are ok.
The Result-Set in the database is "normal
Have you any idea?