I need help with returning multiple values from my api to the httpclient post request but its returning null
api
[HttpPost("ShowUser")]
public (IEnumerable<UserInformation>, int) ShowUser([FromBody] Pagination pagination)
{ // retrieving data from database
var result = _showUsers.ShowManagerUsers(pagination.PageSize, pagination.skip, pagination.searchValue); // the output here is({System.Collections.Generic.List<Entities.UserInformation>}, 37) (note: 37 is the rows total)
Entities.PaginationResponse<IEnumerable<UserInformation>> paginationResponse = new Entities.PaginationResponse<IEnumerable<UserInformation>>
{
Data = result.Item1,
RowsCount = result.Item2
};
return (paginationResponse.Data, paginationResponse.RowsCount);
}
HttpClient Post Request
public async Task<(List<TOut>, TOut)> PostGetListRequest<TIn, TOut>(TIn content, string uri, string token)
{
...
using (response = await client.PostAsync(uri, serialized))
{
if (response.StatusCode.ToString() == "OK")
{
responseBody = response.Content.ReadAsStringAsync().Result;
var result = JsonConvert.DeserializeObject<(List<TOut>, TOut)>(responseBody);
return (result.Item1, result.Item2);
}
...
}
}
Any idea what's wrong with my code?