Is there any way to perform filtering of the entity?
Its like WHERE IN(), but dinamical.
Let say, I have TOrder entity and want to filter (I have already TArray with order numbers).
I tried at least add to Find method:
.Where(Linq['orderid'].Contains( myArray ))
.Where(Linq.contains('orderid', myArray ))
.Where(Linq['myArray ']._In( myArray))
Exactly in that way (I have order.id in varchar ) i did it:
var
z: Variant;
begin
z := VarArrayCreate([0, 1], varOleStr);
for i := 0 to 1 do begin
VarArrayPut(z, IntToStr(i + 10), i);
end;
l = om.Find< TOrder >
.Where(Linq['id'].Contains( z ))
.List;
Here is my entity:
[ Inheritance( TInheritanceStrategy.JoinedTables ) ]
[ Entity, Automapping ]
[ Table( 'order' ) ]
[ Id( 'Fid', TIdGenerator.None ) ]
TOrder = class
private
[ Column( 'id', [ ], 18 ) ]
Fid: string;
But last command "l = om.Find<" gave error "Could not convert variant of type (Array OleStr) into type (OleStr)".