Xamarin.android 在移动客户端中更新行然后同步时出现问题

Xamarin.android 在移动客户端中更新行然后同步时出现问题,xamarin.android,azure-mobile-services,Xamarin.android,Azure Mobile Services,问题:无法从移动客户端更新行(使用脱机同步) 场景:我们正在移动客户端中使用一个类来保存新项目。但是我们在从服务器检索数据时使用的是ClassDto。由于此设置,服务器后端有两个表控制器:ClassController:TableController和ClassDtoController:TableController。前者用于后类请求,后者用于GetAllClass请求 在客户端,移动数据库将要查看的行存储在ClassDto本地表中,并且只有使用移动设备保存的条目才在Class本地表中(即Cl

问题:无法从移动客户端更新行(使用脱机同步)

场景:我们正在移动客户端中使用一个类来保存新项目。但是我们在从服务器检索数据时使用的是ClassDto。由于此设置,服务器后端有两个表控制器:
ClassController:TableController
ClassDtoController:TableController
。前者用于后类请求,后者用于GetAllClass请求

在客户端,移动数据库将要查看的行存储在ClassDto本地表中,并且只有使用移动设备保存的条目才在Class本地表中(即ClassDto条目计数!=Class条目计数)

问题详细信息:我们需要使用该设备编辑类的功能。我们通过将目标ClassDto的所有(已编辑和未编辑的)详细信息(例如id、版本、更新日期、创建日期等)复制到一个新的类实例中,然后在IMobileServicesSyncTable上使用UpdateAsync来实现这一点

ClassController:TableController
中的日志中,请求转到该表,但出现错误

使用try-catch公开异常,我们得到的结果如下:

消息:“处理HTTP请求导致异常。有关详细信息,请参阅此异常的'response'属性返回的HTTP响应。”

堆栈跟踪:

at Microsoft.Azure.Mobile.Server.Tables.EntityUtils.<SubmitChangesAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Mobile.Server.EntityDomainManager`1.<UpdateAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Mobile.Server.EntityDomainManager`1.<UpdateAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Azure.Mobile.Server.TableController`1.<PatchAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at SynthesisServer.Controllers.SaleController.<PatchSale>d__3.MoveNext()

问题:我们如何实现编辑功能?另外,是否可以只使用一个表控制器来保存和检索条目?我们使用了两个控制器,因为无法在移动客户端中进行连接。我们尝试从ClassController返回ClassDto,但结果是出现错误。我们还尝试将ClassDto推送到ClassController,但这再次导致了错误。

非常不清楚您在做什么。为什么不使用一个类?打开诊断日志时,服务器后端会说什么?@AdrianHall我使用了两个类,因为我还不知道如何(从移动客户端)将dto发布到服务器。该应用程序使用dto从相关表中公开所需的属性。请阅读本书——第3章为您提供了所需的大量信息。首先,感谢man写了这本书。几天前找到的,一直在断断续续地阅读。我有几个问题与使用自动映射和自定义域管理器的部分有关,但是probs会为此发布一个新问题吗
{
  "message": "An error has occurred."
}