Why does Ef Core not save my data in the database?
I have four models that are saved in sql server with Ef-Core and these four are Order, Contact, Address and BillingInfo.
Each Order has Contact and BillingInfo.
Each Contact has an Address.
Each BillingInfo has an Andress, too.
The problem is whenever i try to save it in the database i receive an error like this:
and this is my code:
Each Order has Contact and BillingInfo.
Each Contact has an Address.
Each BillingInfo has an Andress, too.
The problem is whenever i try to save it in the database i receive an error like this:
{"The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_WSOrderAddresses_WebshopBillingInfoPocos_WebshopBillingInfoPocoID\". The conflict occurred in database \"DatabaseService_Name\", table \"dbo.WebshopBillingInfoPocos\", column 'Id'.\r\nThe statement has been terminated."}and this is my code: