【发布时间】:2017-02-09 16:44:22
【问题描述】:
我的代码运行良好,但现在在等待InsertAsync 函数时,我的所有TableControllers 都出现错误。这是代码:
// 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 确保在项目属性中使用正确的框架 >=4.5。我进一步阅读,然后有人因为 Microsoft.Bcl 而遇到了类似的问题。检查您的依赖关系并尽可能删除 Microsoft.Bcl。
-
@Peter Bons,我添加了一个显示其签名的编辑。 Sebi,我有 4.5 的框架,但它仍然失败。它一直在与 Microsoft.Bcl 合作,所以我不确定为什么会这样。我会尝试删除它,看看是否有任何变化。
标签: c# azure xamarin.ios azure-mobile-services