Page 1 of 1

how to use EntityQuery

Posted: Thu 19 Dec 2019 12:36
by waterful168
hi
sql is -> select * from Emp
use sqlite ->demo.db3

how to use EntityQuery
EntityQuery1.LINQ.Text := 'Linq.From(Emp).Select'; -> can not use

Thanks
billyChou

Re: how to use EntityQuery

Posted: Fri 10 Jan 2020 11:33
by MaximG
The fundementals of working with EntityCollection are covered in our docs: https://www.devart.com/entitydac/docs/c ... y_list.htm
EntityDAC is distributed with an example ( [EntityDAC Demo folder]\Demos\EntityDemo\ ) that explains how to work with LINQ queries.
A query for retrieving all rows from the emp table using EntityQuery will look like this:

Code: Select all

EntityQuery.LINQ.Text :=  'from e in emp';

Re: how to use EntityQuery

Posted: Sun 12 Jan 2020 23:37
by waterful168
Thanks is ok

code share

Code: Select all

procedure TMain.Button8Click(Sender: TObject);
var
  DemoContext : TDemoContext;
  e: IEmpExpression;
  Query: ILinqQueryable;
begin
  DemoContext := Demo.Context.TDemoContext.Create(nil);
  e := DemoContext.Emp;
  EntityQuery1.LINQ.Text := 'from e in emp';
   EntityQuery1.Active := True;
end;

Re: how to use EntityQuery

Posted: Mon 13 Jan 2020 10:02
by MaximG
Please don't hesitate to contact us with questions concerning our product usage.

Re: how to use EntityQuery

Posted: Thu 02 Apr 2020 12:26
by ketas
Hi,
you did answer that docu is here: https://www.devart.com/entitydac/docs/c ... y_list.htm
and example was EntityQuery.LINQ.Text := 'from e in emp';
Nowhere in documentation is this example and nowhere i found syntax
for property TEntityQuery.LINQ.Text , eg. order by etc.
LINQ syntax can not be used there. There are some documentation TEntityQuery.LINQ.Text?
Thanks Vojslav

Re: how to use EntityQuery

Posted: Fri 03 Apr 2020 15:26
by MaximG
Refer to the official documentation for more information about constructing LINQ queries: https://docs.microsoft.com/en-us/dotnet ... using-linq