I’m working on a small .NET Core Web Api project
I’m using repository pattern with entityframework
The project is working fine overall but there is something I don’t understand and
I would appreciate if someone could tell me why it is working properly.
Please look at the attached images
In Swagger UI, I’m creating a new patient record and it is working fine
So far it is working fine – but when I try to bind a record in
the Recommendation Table to an already existing patient – it is not working properly.
It is just creating a new patient with null values.
See images below
Can someone please tell me why this is happening.
I did not post the code here as it would be to much code.
On request – I will post my code
Check the model of the recommendation class (model for your table). You need to fetch the patient first and then assign the object to the recommendation object then save the changes to the database.