[英]GetItemsAsync returns no items using .Net MAUI
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.我已将一些代码从旧的 Azure 移动客户端迁移到 DataSync,并且 GetItemsAsync 方法返回 0 个项目,尽管数据库中有项目。
Here is the code snippet public async Task<IEnumerable<Configuration>> GetItemsAsync() { await InitializeAsync(); return await _table.GetAsyncItems().ToListAsync(); }
这是代码片段
public async Task<IEnumerable<Configuration>> GetItemsAsync() { await InitializeAsync(); return await _table.GetAsyncItems().ToListAsync(); }
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.如果我通过 web 门户执行完全相同的命令,则会返回正确的结果。
I am expecting the GetAsyncItems to return a list of items (as it did previous using the Mobile Service Client package).我期待 GetAsyncItems 返回一个项目列表(就像之前使用移动服务客户端包所做的那样)。
The call returns a list of 0 items.该调用返回一个包含 0 个项目的列表。
If I examine the http traffic, the correct request is sent to Azure and the correct response is returned.如果我检查 http 流量,则会将正确的请求发送到 Azure 并返回正确的响应。
Based on your final comment, you are using the client that uses the v3.0.0 ZUMO-API-VERSION and you are using the v2.0.0 ZUMO-API-VERSION backend.根据您的最终评论,您正在使用使用 v3.0.0 ZUMO-API-VERSION 的客户端,并且您正在使用 v2.0.0 ZUMO-API-VERSION 后端。 I'm surprised it is working at all.
我很惊讶它能正常工作。
When thinking about the ZUMO-API-VERSION在考虑 ZUMO-API-VERSION 时
2.0.0 client works with either a 2.0.0 or 3.0.0 server. 2.0.0 客户端与 2.0.0 或 3.0.0 服务器一起工作。 3.0.0 client ONLY works with a 3.0.0 server.
3.0.0 客户端仅适用于 3.0.0 服务器。
So you can update the server, then update the clients, but not the other way round.所以你可以更新服务器,然后更新客户端,但反过来不行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.