Good afternoon,
I have a web API running just fine and a Xamarin forms app on top of it.
There I want to create 1:N relation which is fine in the model but I have the following problem:
(I don't want to post all the code here so I bring it down to the problem).
Model Header
public long header_Id {get;set;}
...several other fields
Model Details
public long details_Id {get;set;}
public long header_Id {get;set;}
....several other fields
The fields header_Id and details_Id are auto-generated as identity-fields in Azure SQL Server
PROBLEM:
I post the header model with "response = await client.PostAsync(uri, content);"
Record is created fine.
BUT now I need the header_Id to create my 1:N Details records.
How can I get the Id of the just created record?
I cannot use any SQL-Command here because as I have an WEBAPI between the App and the SQL-Server I cannot execute SQL queries directly against the database.