how to use EntityQuery

Discussion of open issues, suggestions and bugs regarding EntityDAC
Post Reply
waterful168
Posts: 1
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: 1822
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: 1
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: 1822
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.

ketas
Posts: 28
Joined: Thu 02 Sep 2010 12:08

Re: how to use EntityQuery

Post by ketas » Thu 02 Apr 2020 12:26

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

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

Re: how to use EntityQuery

Post by MaximG » Fri 03 Apr 2020 15:26

Refer to the official documentation for more information about constructing LINQ queries: https://docs.microsoft.com/en-us/dotnet ... using-linq

Post Reply