jhipster / jhipster-net-sample-app-template

JHipster.NET sample application
50 stars 18 forks source link

Create a new instance of an entity referenced another #17

Closed BananeGuimauve closed 5 years ago

BananeGuimauve commented 5 years ago

Currently, when we try to create a new instance of an entity containing a reference to another (via an HTTP POST), EF try to add again in the database the instance referenced because it is attached to the first one. Obviously, the instance attached exists and the request return a 500 error code and a Unique Constraint error in the body.

Example : Try to create a new instance of the BankAccount entity.