Closed M-Zuber closed 8 years ago
Brain dump on the matter:
Since the categories are called with AsNoTracking, they seem to be treated as new items when saving the transaction.
Before any of this, look if there is a setting for CodeFirst that controls the creation of sub objects
As a precondition, maybe add unique indexes to the appropiate tables - code can be found in VirtualGabbai
First try and see if just removing the AsNoTracking is enough
If that does work, before saving the item, pull the categories from the database and set the properties to be equal to the object that is returned
Last ditch scenario is too revert to having seperate sets of objects.
Per this article the change is to update the non-read actions to use FK properties.
I am not sure what layer the code that causes the bug is on... [EDIT] See below as the issue is caused when entering a new transaction