GetItemsAsync returns no items

Brenden Jacobson 6 Reputation points
2022-11-20T00:24:59.267+00:00

I have migrated some code from the old Azure Mobile Client to DataSync, and the GetItemsAsync method is returning 0 items, although there are items in the database.

Here is the code snippet
public async Task<IEnumerable<Configuration>> GetItemsAsync()
{
await InitializeAsync();
return await _table.GetAsyncItems().ToListAsync();
}

If I execute the exact same command through the web portal the correct result is returned.

Here is the http trafffic
[HTTP] >>> GET https://<removed>.azurewebsites.net/tables/configuration
[HTTP] >>> ZUMO-API-VERSION: 3.0.0
[HTTP] >>> User-Agent: Datasync/5.0.0.0
[HTTP] >>> User-Agent: (lang=dotnet6;os=Windows/Microsoft Windows NT 10.0.22621.0;arch=X64;version=5.0.0.0)
[HTTP] >>> X-ZUMO-VERSION: Datasync/5.0.0.0 (lang=dotnet6;os=Windows/Microsoft Windows NT 10.0.22621.0;arch=X64;version=5.0.0.0)
[HTTP] >>> X-ZUMO-INSTALLATION-ID: d52938c7-d61a-42b4-8b7c-b39291c5bd6b

[HTTP] <<< OK OK
[HTTP] <<< Date: Sun, 20 Nov 2022 00:16:28 GMT
[HTTP] <<< Server: Microsoft-IIS/10.0
[HTTP] <<< Access-Control-Expose-Headers: Request-Context
[HTTP] <<< Cache-Control: no-cache
[HTTP] <<< Pragma: no-cache
[HTTP] <<< Set-Cookie: ARRAffinity=3af96001380f1cf5a9d4a0be3017de51b46e5f368f46d647161d85795c4ee928;Path=/;HttpOnly;Secure;Domain=<removed>.azurewebsites.net
[HTTP] <<< Set-Cookie: ARRAffinitySameSite=3af96001380f1cf5a9d4a0be3017de51b46e5f368f46d647161d85795c4ee928;Path=/;HttpOnly;SameSite=None;Secure;Domain=<removed>.azurewebsites.net
[HTTP] <<< Vary: Accept-Encoding
[HTTP] <<< x-zumo-server-version: net-2.0.3
[HTTP] <<< Request-Context: appId=cid-v1:de8808e9-614a-45d3-97e2-d397098d7d78
[HTTP] <<< X-Powered-By: ASP.NET
[HTTP] <<< Content-Type: application/json; charset=utf-8
[HTTP] <<< Expires: 0

[HTTP] <<< [{"deleted":false,"updatedAt":"2021-07-07T07:02:39.053Z","createdAt":"2021-07-07T07:02:39.053Z","version":"AAAAAAAA600=","id":"62fd9992e5294d4086a0eb55e709c153","lastUpdate":"2021-07-07T07:02:37.749Z","information":"2023","currentSeason":"ae53d7f958da4beb8b5f0721560ec50c"},{"deleted":false,"updatedAt":"2022-11-19T13:16:56.086Z","createdAt":"2022-11-19T13:16:56.086Z","version":"AAAAAAAA8kc=","id":"a6d6118742744bcba1940e320ef1307b","lastUpdate":"2022-11-19T13:16:54.054Z","information":"Newly created by app","currentSeason":null},{"deleted":false,"updatedAt":"2022-11-19T13:20:35.296Z","createdAt":"2022-11-19T13:20:35.296Z","version":"AAAAAAAA8kg=","id":"f20a10dda1df4274a1f347ff37fd60db","lastUpdate":"2022-11-19T13:20:34.71Z","information":"Newly created by MAUI app","currentSeason":null}]

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
Developer technologies .NET .NET MAUI
Developer technologies .NET Other
Developer technologies ASP.NET Other
{count} votes

1 answer

Sort by: Most helpful
  1. Brenden Jacobson 1 Reputation point
    2022-12-19T01:57:57.787+00:00

    After many hours of experimenting I have solved the problem:

    • The Azure backend was built using Azure mobile v4.2.0
    • The client was built using v5.0.0
    • These have different ZUMO-API-VERSIONs

    The code atboth ends builds and runs correctly, however the item list from GetItemsAsync always returns success with 0 items.

    However when the backend was built using v5.0.0, the code works correctly.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.