Hello Wagner,
I have a global function that loads data via XData.
I want to be able to pass different classes (TCustomer, TInvoice, ...)
But AureliusDataset only creates the fields for me when I call the function via xDataClient.List( Query) and not xDataClient.List( MyClass, Query)
function TdmSngModel.TGridAdapterControl.Load(AClass: TClass; AQueryString: String): TDataset;
var
QB: IXDataQueryBuilder;
LProp: TRttiProperty;
tempList: TList<TObject>; // Only for debugging
tempList: TList<TCustomer>; // Only for debugging
begin
Parent.AureliusDataset.Close;
// Parent.AureliusDataset.SetSourceList( Parent.xClient.List( AClass, AQueryString));
// Result := Parent.AureliusDataset;
tempList := Parent.xClient.List( AClass, AQueryString); // I have no fields, because Aurelius sees only TObject
tempList := Parent.xClient.List<AClass>( AQueryString); // This don't work. {E2531 Method '%s' requires explicit type argument(s)}
tempList := Parent.xClient.List<TCustomer>( AQueryString); // This would work but is specialized
Parent.AureliusDataset.SetSourceList( tempList);
Result := Parent.AureliusDataset;
end;
I've seen that Aurelius only works internally with object lists.
What can I do to be able to work globally with the passed class here?
Or is it a simple "ignorance" on my part regarding Delphi to use the right call?
Thomas