I have an API controller which is calling a 3rd party API, and then deserializing it via two API models to C#. I am using JsonObject and JsonProperties in the API models.
Now I need to gather properties from both models in my response to the client. In the controller I have created two C# objects, each one getting info from the API models. I want to create a object holding specific properties from both objects. Can anyone advise on the best practice to accomplish this?
var personJson = await personResponse.Content.ReadAsStringAsync();
var companyJson = await companyResponse.Content.ReadAsStringAsync();
var UserObject = JsonConvert.DeserializeObject<Person.RootObject>(personJson);
var CompanyObject = JsonConvert.DeserializeObject<Company.RootObject>(companyJson);