我们有一个持久化支持对象,它在数据库中有一个version字段。假设这个类中有很多无关的代码。
#
# We're branching on this "version" field, and we return one
# of 2 policies.
#
class Foo
def policy
if version == 'a'
PolicyA.new
else
PolicyB.new
end
end
end
#
# PolicyA calls a single check on a col
我无法在我的MvvmCross Windows 7.1项目中使用等待关键字,而使用Microsoft.Bcl“Microsoft.Bcl便携包”。
我已经在上发布了下面描述的示例项目的代码。
当我试图构建包含FirstViewModel的第三个“核心”Windows可移植类库(PCL)时,我会得到以下错误:
Type System.Threading.Tasks.Task<string> not awaitable under VS red squiggles, and
Cannot await 'System.Threading.Tasks.Task<string&