Hi,
I need to return multiple objects from GET method:
[HttpGet]
[ActionName("GetTimesheets")]
[AllowAnonymous]
public (List<ListTimesheets>, Errors) GetTimesheets([FromBody] TimeSheetBO timeSheetBO)
{
(List<ListTimesheets> ListTimesheetsTmp, Errors ErrorTmp) = TimesheetDAL.GetUserTimesheets(timeSheetBO);
return (ListTimesheetsTmp, ErrorTmp);
}
from Blazor page I cannot receive the correct values:
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri(@MySettings["URLTimeReportRestAPI"] + "/ControllerName/GetTimesheets"),
Content = new StringContent(JsonConvert.SerializeObject(ObjTimeSheet), System.Text.Encoding.UTF8, "application/json"),
};
(var ListTimesheetsTmp, var ErrorTmp) = await http.SendJsonAsync<(List<ListTimesheets>, Errors)>(request.Method, request.RequestUri.ToString(), ObjTimeSheet);
both objects (ListTimesheetsTmp, ErrorTmp) are NULL.
Any idea?
Best
Stefano


