【发布时间】:2013-03-27 15:57:01
【问题描述】:
我正在尝试在 Windows 运行时组件中使用 sqlite。但是当我添加 nuget sqlite-net 包时出现一些 219 错误。无法在任何地方弄清楚。有没有类似的问题?
我终于使用了一个商店应用类库来使用 sqlite,并从我的 windows 运行时组件中调用了其中的那些方法。
商店应用中的方法
public async Task<IEnumerable<TaskGroup> > GetTaskGroup()
{
return await conn.QueryAsync<TaskGroup>("select * from TaskGroup");
}
在win运行时组件中调用方法
public IAsyncOperation<IEnumerable<TaskGroup>> GetAllTaskGroup()
{
return m_objDAL.GetTaskGroup().AsAsyncOperation();
}
我收到以下错误
Error 1 Method 'Tasker.BAL.TaskManager.GetAllTaskGroup()' has a parameter of type 'Windows.Foundation.IAsyncOperation<System.Collections.Generic.IEnumerable<SQLLite.Models.TaskGroup>>' in its signature. Although this generic type is not a valid Windows Runtime type, the type or its generic parameters implement interfaces that are valid Windows Runtime types. Consider changing the type 'SQLLite.Models.TaskGroup' in the method signature. It is not a valid Windows Runtime parameter type.
将商店应用程序方法设为私有可根据此博客解决它 http://rarcher.azurewebsites.net/Post/PostContent/23
但我不能使用它,因为它是私有的,它会给我带来访问问题。
有什么办法吗?
【问题讨论】:
标签: sqlite windows-8 windows-runtime windows-store-apps