How can I delete an item explicit by an ID?
Now, I have first to retrieve an item from the database (e.g. SomeContext.GetEntity<TSomeEntity>), before I can execute DeleteAndSave, is it right?
Thank you!
I would like to have a functionality like shown below:
Code: Select all
var
SomeEntity: TSomeEntity;
SomeContext: TEntityContext;
begin
SomeEntity := TSomeEntity.Create;
SomeEntity.Id = 1234; // <-- this is a primary key
SomeContext.Delete(SomeEntity);
SomeContext.Save(SomeEntity);
end;