Hi,
i try to use entitydac and i would like to know if there are some info to Linq property of TEntityQuery
and how can i define fields for this query. In documentation there is information for LINQ syntax, but this is
not usable in this property. I found in this forum only one answer with something
like "from e in emp" , but i think that is not really enough. I would like to use components, not coding
queries in source code (only way used in demo). I used unidac with design of queries in design time
(Sql property of TUniQuery) and i would like use entitydac the same way. Thanks for answer. Vojslav
TEntityQuery syntax
Re: TEntityQuery syntax
To run LINQ queries with the TEntityQuery component, use the property TEntityQuery.LINQ : h[url]ttps://www.devart.com/entitydac/docs/devart.en ... y.linq.htm[/url]
For example, the below query selects particular fields from Emp table and returns them in sorted order:
Refer to the official documentation for more information about constructing LINQ queries: https://docs.microsoft.com/en-us/dotnet ... using-linq
Note that EntityDAC supports only basic LINQ queries. You can find respective examples in the EntityDemo project, which is distributed with EntityDAC.
For example, the below query selects particular fields from Emp table and returns them in sorted order:
Code: Select all
EntityQuery.LINQ.Text := 'From E In Emp OrderBy(E.EName) Select(E.EName, E.Job, E.Dept.DName)';
Note that EntityDAC supports only basic LINQ queries. You can find respective examples in the EntityDemo project, which is distributed with EntityDAC.