I have two tables ,
1. News
2. Shop
And I have creating three API's
1. GetNews
2. PostNews
3. DeleteNews
Now, I want to insert the data by using PostNews API. But there is a problem in News Table that Shop Table contain PK(id) which is FK in News Table, so how can i insert the data in News Table, require code snippet for API....


Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted Apr 29, 2016, 3:49 AM EDT
Hope you are using the Entity Framework,
you have to have valid row of data in [Shop] before inserting any data reference to [News] table.
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted Apr 29, 2016, 3:47 AM EDT
Dr.Ajay KashyapRank #2,900 · 496 reputationPosted May 9, 2016, 4:07 AM EDT
Vincent Maverick Durano