Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

EntityCreatedEventData entity has Id = 0? #1679


User avatar
0
mikek created

Hi,

I've just upgrade to 0.12.0 and my entity created event handler is now failing because the entity data passed in has an id = 0. Running the tests, it seems that SaveChanges() is firing the entity created event before committing the changes & resolving the new id. Is this expected behaviour?

Thanks! mike


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    No, definitely not. Do you handle event for your own entity or one of the entities in default AspNet Zero. I'm asking it to be able to re-produce the problem.

    Note: You can also create a Github issue for that since it seems like a bug if you are right.