I’m experimenting with Blazor. I’m calling a ServiceStack AutoQuery service with the following:
@code {
Tenant[] tenants;
protected override async Task OnInitializedAsync()
{
tenants = await Http.GetJsonAsync<Tenant[]>
("http://localhost:5001/tenants");
}
public class Tenant
{
public string Name { get; set; }
}
}
The problem I’m having is that because AutoQuery is returning the data in the the Results property of the response, rather than the root (as with a traditional web api call), it’s erroring out at GetJsonAsync<Tenant[]> because it’s not mapping correctly.
What is the proper way to do this with AutoQuery?