如何在MVVMCross中使用Community SQLite插件 [英] How to use Community SQLite plugin in MVVMCross
问题描述
在我的应用程序中,我正在使用旧的SQLite插件. 从MVVMCross 3.0.14开始,不推荐使用此版本,建议使用Community.Sqlite插件.
In my application I was using the old SQLite-plugin. Since MVVMCross 3.0.14 this version is deprecated and the Community.Sqlite plugin is advised.
社区插件是通过Nuget添加的.
The Community plugin was added via Nuget.
在尝试使用没有引导程序的插件时,在运行时出现错误:
When trying to use the plugin without a bootstrapper, at runtime I get the error:
创建时无法解析ISQLiteConnectionFactory类型的参数connectionFactory的参数...
Failed to resolve parameter for parameter connectionFactory of type ISQLiteConnectionFactory when creating...
当尝试将插件与引导程序一起使用时,也在运行时,出现错误:
When trying to use the plugin with a bootstrapper, also at runtime, I get the error:
未为Cirrious.MvvmCross.Community.Plugins.Sqlite类型注册的插件
plugin not registered for type Cirrious.MvvmCross.Community.Plugins.Sqlite
该插件应如何使用?
-编辑- 这是我的引导程序代码:
-Edit- This is my bootstrapper code:
using Cirrious.MvvmCross.Community.Plugins.Sqlite;
public class SqlitePluginBootstrap : MvxPluginBootstrapAction<PluginLoader>
{
}
推荐答案
好吧,Nuget添加了对可移植库的引用.我添加了对Sqlite.Touch库的引用,然后更改了我的引导程序:
Okay, Nuget added a reference to the portable library. I added a reference to the Sqlite.Touch library and then altered my bootstrapper:
using Cirrious.MvvmCross.Community.Plugins.Sqlite;
using Cirrious.MvvmCross.Community.Plugins.Sqlite.Touch;
public class SqlitePluginBootstrap : MvxLoaderPluginBootstrapAction<PluginLoader, Plugin>
{
}
这为我解决了未注册插件"错误.
This solved the "plugin not registered"-error for me.
这篇关于如何在MVVMCross中使用Community SQLite插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!