I am trying to follow along with this:
This is my JSON string I need to send to the API endnpoint:
{
"search":
[
{"queryString":"test"},
{"queryParameter01": "blah blah blah"},
{"queryParameter02": "blah blah blah"},
{"queryParameter03": "blah blah blah"}
]
}
For my data models, I have this:
public class SearchRequest
{
public String search{ get; set; }
}
public class QueryStringRequest
{
public String queryString { get; set; }
}
public class QueryParameterRequest
{
public String queryParameter { get; set; }
}
I know I need an array of QueryStringRequest and QueryParameterRequest objects in the SearchRequest object, but I can't figure it out. Also, does the SearchRequest object return a String or something else?
I ask because I will be using JsonSerializer.Serialize later to turn my object into a JSON string to send to the API endpoint, so it seems "pointless" to return a string to serialize into a string.