Prevent Linq from using keyword AS

Prevent Linq from using keyword AS

Postby sBecker » Mon 03 Apr 2017 13:04

Hi guys,

today I started to test EntityDAC + Delphi 10 Seattle. I managed to create a sample model with Entity Developer, included the generated files into my project and set up all necessary components to establish a connection:
• TEntityConnection (ProviderName = IBDAC)
• TIBDACDataProvider
• TEntityXMLModel
• TEntityContext
• TEntityDataSource
• TEntityDataSet

In Delphi I created a form with one button that performs the following code:

Code: Select all
procedure TForm2.btnOpenClick(Sender: TObject);
var
  query : ILinqQueryable;
  dataContext : TDataContextTest;
  myObject : IMyObject;
begin
  dataContest := TDataContextTest.Create(self);
  myObject := dataContext.MyObject;

  query := From(myObject).Select([myObject.NR, myObject.Date1])

  entityDataSet1.SourceCollection := entityContext1.GetEntities(query);
  entityDataSet1.Open;
end;


When I click the button, the following SQL-Statement will be created:

SELECT t1.nr AS nr, t1.date1 AS date1 FROM tableA AS t1;


The problem is, that Interbase 2009 (Dialect 1) does not accept the keyword AS for tables. You can use aliases but without AS (SELECT x.nr FROM tableA x)

So, I need to prevent Linq from using it, so that the SQL will look like this:

SELECT t1.nr AS nr, t1.date1 AS date1 FROM tableA t1;


or without AS at all

SELECT t1.nr nr, t1.date1 date1 FROM tableA t1;



Any suggestions?
sBecker
 
Posts: 1
Joined: Mon 03 Apr 2017 12:33

Re: Prevent Linq from using keyword AS

Postby MaximG » Wed 05 Apr 2017 06:50

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.
MaximG
Devart Team
 
Posts: 767
Joined: Mon 06 Jul 2015 11:34


Return to EntityDAC