I have a post request in the project and I get a list in the body section. This service was requested to be converted to a get request and I need to get the list I get in the body as a query. The type of the list is a custom model. What is the best way to do this?
[HttpPost(nameof(UserQuery))]
public IActionResult UserQuery(ExampleModel query)
{
...
return Ok();
}
public class ExampleModel
{
public List<Example2Model> Example2Models { get; set; }
}
public class Example2Model
{
public string Name { get; set; }
public string SurName { get; set; }
public string PhoneNumber { get; set; }
}
I want to convert the old request like the one above into a get request. What is the most logical solution? What is the best way to do this since the query length will increase as the number of elements in the list increases?
8