android - Azure 客户端 IServiceFilter 不起作用

标签 android azure xamarin.android xamarin

我正在尝试使用官方 xamarin 的 azure 组件在我的 Android 应用程序中实现 Azure 移动服务。我必须使用过滤器调用 asure 服务,我只是这样做了:

class Filter : IServiceFilter 
{ 
    public System.Threading.Tasks.Task Handle(IServiceFilterRequest request, IServiceFilterContinuation continuation) 
    { 
        throw new NotImplementedException(); 
    } 
}

如您所见,这是 IServiceFilter 的简单实现,但失败了!这是错误

TimestampFilter' does not implement interface member 'Microsoft.WindowsAzure.MobileServices.IServiceFilter.Handle(Microsoft.WindowsAzure.MobileServices.IServiceFilterRequest, Microsoft.WindowsAzure.MobileServices.IServiceFilterContinuation)'. 'TimestampFilter.Handle(Microsoft.WindowsAzure.MobileServices.IServiceFilterRequest, Microsoft.WindowsAzure.MobileServices.IServiceFilterContinuation)' cannot implement 'Microsoft.WindowsAzure.MobileServices.IServiceFilter.Handle(Microsoft.WindowsAzure.MobileServices.IServiceFilterRequest, Microsoft.WindowsAzure.MobileServices.IServiceFilterContinuation)' because it does not have the matching return type of 'System.Threading.Tasks.Task'

谁知道为什么?谢谢

最佳答案

错误消息表明返回类型不正确,因此我查看了程序集浏览器:

public Task<IServiceFilterResponse> Handle(IServiceFilterRequest request,IServiceFilterContinuation continuation) 
{ 
    throw new NotImplementedException(); 
} 

现在应该可以编译了

关于android - Azure 客户端 IServiceFilter 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16054928/

相关文章:

c# - Azure 云服务的 for 循环在生产环境中比在本地主机上慢得多

c# - Azure应用程序服务无法连接到通过公共(public)IP公开的本地数据库

C# Xamarin.Android 图像显示在文件管理器中而不是库中

c# - 降级 Xamarin.Android

android - Xamarin 安卓播放器 : Camera error Cant connect to Camera

c# - 与 firebase 集成的 Unity 可在 Unity 编辑器上运行,但不适用于移动设备

java - android 线程和处理程序最佳实践

android - 在 android 中将谷歌地图缩放到以英里为单位的特定半径

asp.net - 如何在 REST Web 服务中处理使用 100 Continue?

java - OnCreateOptions 被调用,但 OnOptionsItemSelected 未被调用