I have a search function that I call in the web client using RawInvoke. I pass the values for Skip and Take in my parameter. The server performs the following function:
function KundeSearch_V1( APageSize, APageIndex: Integer; const ASuchtext: String; ASuchmodus: String; AOrderBy: String): TList<TKunde>;
var
Criteria: TCriteria<TKunde>;
OrderList: TStringlist;
i: Integer;
OrderField: String;
idxField: Integer;
begin
Criteria := TXDataOperationContext.Current.GetManager.Find<TKunde>;
Criteria.CreateAlias( DicKunde.Kunde.Person.AssociationName, 'p');
makeFilter_V1( Criteria, 'p.', ASuchtext, ASuchmodus); // complex Filter !!!
if APageSize > 0 then
Criteria.Skip( APageIndex*APageSize).Take( APageSize);
Result := Criteria.List;
end;
I would now like to determine the "inlinecount" in the server at the same time.
Is there a function or parameter I can use here?
Or can I use the "TCriteria" to issue a count command myself?
That will work fine.
You can add more code just in case your Criteria already has the paging or have order (some databases don't allow ORDER BY clause when you do a Count(*). So you can also add this: