Delete - Cannot find mapping [Id] on class TFDPhys

Hi,

I have a problem when I want to delete a object.


    PersonList := FRepository.GetPersonList(FKunde);

    for Person in PersonList do

      FRepository.DeletePerson(Person);

 

I get an

'Cannot find mapping [Id] on class TFDPhysPreprocessor.' Error.

 

The Manager is not destroyed or renewed between object creation and the above line of codes, I checked that.

I created a dictionary for all Entities.

 

I use MS SQL with FireDAC.

 

Can you help please?


Regards Florian

What does FRepository.DeletePerson do? It's not Aurelius code.

My guess is that maybe calling Manager.Remove(Person) will also fire removing of associated objects, that in turn might be other Person objects that you are further deleting (and thus destroying) again in your loop. But it's hard to guess and you didn't provide your mapping neither the code that is causing the problem.