Aurelius 5.13.0.0
XData 5.10.0.0.
Delphi 10.4
I get an exception (EIdNotSetException) when trying to list values from a very simple entity.
To me, it looks very much like this one:
In my situation I have:
Table ELFFrequency:
CREATE TABLE dbo.ELFFrequency (
ID Int NOT NULL,
Name NVarChar(10) NOT NULL,
Description NVarChar(50),
CONSTRAINT PK_ELFFrequency PRIMARY KEY CLUSTERED (
ID
)
)
GO
Data in table:
Model:
[Entity]
[Table('ELFFrequency')]
[Id('FID', TIdGenerator.None)]
TELFFrequency = class
private
[Column('ID', [TColumnProp.Required])]
FID: Integer;
[Column('Name', [TColumnProp.Required], 10)]
FName: string;
[Column('Description', [], 50)]
FDescription: Nullable<string>;
public
property ID: Integer read FID write FID;
property Name: string read FName write FName;
property Description: Nullable<string> read FDescription write FDescription;
end;
Code that raises exception:
function TServices.GetELFFrequency: TList<TELFFrequency>;
begin
// LEO 06.02.2023: Test to raise exception
Result := TXDataOperationContext.Current.GetManager.Find<TELFFrequency>.List;
end;
The exception I get is: ".....raised exception class EIdNotSetException with message 'Id not set on entity of class TELFFrequency.'."
Is this a bug or am I maybe overlooking something here?
Thank you,
Leif Eirik