OData API return Id of created record

Is there a way to get the primary key id of a newly inserted record via a OData API?

I have the below, the response is what it is? Probably not going to be able to return the Id?

        private async Task<HttpResponseMessage> SaveVehicleViaAPI(Vehicle vehicle)
        {
            var uri = new Uri(baseAPIURL + "odata/sql_database/Vehicles");

            var httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, uri);

            httpRequestMessage.Content = new StringContent(Radzen.ODataJsonSerializer.Serialize(vehicle), Encoding.UTF8, "application/json");

            var response = await httpClient.SendAsync(httpRequestMessage);
            return response;
        }

The generated code from Radzen Blazor Studio for CreateXXX returns the newly created item:

1 Like

Thank you. I modified the APIs because I could not get them to work at all, but we found out that was because program.cs was wrong.

Now using APIs as designed, OData is powerful, happy that I am learning about it.