我的代码工作正常,但现在我在等待InsertAsync
函数时出现所有TableControllers
上的错误。这是代码:正在等待Azure移动服务TableController中的InsertAsync错误
// POST tables/Account
public async Task<IHttpActionResult> PostAccount(Account item)
{
Account current = await InsertAsync(item);
return CreatedAtRoute("Tables", new { id = current.Id }, current);
}
错误说: Cannot await System.Threading.Tasks.Task<sampleAppService.DataObjects.Account> expression
。
我不知道是什么原因造成的。任何帮助?
编辑
的InsertAsync功能
protected virtual Task<TData> InsertAsync (TData item);
请张贴(签名) 'InsertAsync'方法 –
@naffie确保在Project-Properties> = 4.5中使用正确的框架。此外,我读过,然后由于Microsoft.Bcl,有人遇到类似的问题。如果可能,请检查您的依赖关系并删除Microsoft.Bcl。 – Sebi
@Peter Bons,我添加了一个显示它的签名的编辑。塞比,我在4.5的框架,但它仍然失败。它一直在与Microsoft.Bcl合作,所以我不确定为什么它会是原因。我会尝试删除它只是为了查看是否有任何更改。 – naffie