简体   繁体   English

GetItemsAsync 使用 .Net MAUI 不返回任何项目

[英]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.

相关问题 如何使用Azure Mobile检索50多个项目 - How to retrieve more than 50 items using Azure Mobile 将Azure软件包与.NET Core / MVC一起使用 - Using Azure packages with .NET Core / MVC 在Azure移动服务.NET中使用DTO会引发目标调用异常 - Using DTO in Azure Mobile Service .NET throws target invocation exception 使用ASP.NET Identity扩展Azure移动服务的功能 - Extend functionality of Azure Mobile Services using ASP.NET Identity 使用ASP.NET 4.0成员资格提供程序与Azure移动服务 - Using ASP.NET 4.0 membership provider with Azure Mobile Services 使用单个用户帐户的Azure移动服务.net后端身份验证 - Azure Mobile Services .net Backend Authentication using individual user accounts 如何首先使用代码在Sql Azure .NET中添加一对多关系? - How to add one-to-many relationships in Sql Azure .NET using code first? 使用.NET后端的Azure移动服务与关系数据库的离线同步行为 - Azure Mobile Service offline syncing behavior with relational database using .NET backend 使用.Net后端Azure移动服务中的Microsoft帐户对用户进行身份验证,登录后出现错误 - Authenticate user using Microsoft Account in .Net backend Azure Mobile service giving error after login 使用Azure移动服务(.Net后端)的android设备特定的推送通知 - android device specific push notifications by using azure mobile services (.Net backend)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM