Possible Duplicate:
DBContext Added/Attached Event?
I'm using a custom ID-Generating
strategy in EF 5. I override the SaveChanges
method to detect added entities and set them ID
s. But the new entities's ID
is not accessible until calling SaveChanges
. I search SO and find some answers. Here and here. In the second link, @KVerwold
's answer shows a way to detect changes that seems works. But it has just one up-vote and not accepted. Can I use @KVerwold's suggested way? Do you think it may couse any error -logical or any? OR do you have any other suggestions please? Thanks in advance.