在 Xamarin Forms 解决方案中。我在 AppName.iOS 项目资源文件夹中有一个 sqlite 数据库。这是一个数据库,每个表中有许多表和记录。
我正在尝试使用以下内容加载它:
public SQLiteAsyncConnection GetConnection()
{
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Resources);
var path = Path.Combine(documentsPath, "InfoDb.sqlite");
return new SQLiteAsyncConnection(path);
}
当我导航到数据库的“路径”时,该文件不存在。预加载的数据库应该在项目中的什么位置?