how to use EntityQuery

Discussion of open issues, suggestions and bugs regarding EntityDAC
Post Reply
waterful168
Posts: 3
Joined: Sun 11 Apr 2010 02:07

how to use EntityQuery

Post by waterful168 » Thu 19 Dec 2019 12:36

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

MaximG
Devart Team
Posts: 1469
Joined: Mon 06 Jul 2015 11:34

Re: how to use EntityQuery

Post by MaximG » Fri 10 Jan 2020 11:33

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';

waterful168
Posts: 3
Joined: Sun 11 Apr 2010 02:07

Re: how to use EntityQuery

Post by waterful168 » Sun 12 Jan 2020 23:37

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;

MaximG
Devart Team
Posts: 1469
Joined: Mon 06 Jul 2015 11:34

Re: how to use EntityQuery

Post by MaximG » Mon 13 Jan 2020 10:02

Please don't hesitate to contact us with questions concerning our product usage.

Post Reply