public ObservableCollection<AppUser> AppUser { get; set; }
public AppUserDbConnect(string dbPath)
{
_database = new SQLiteAsyncConnection(dbPath);
_database.CreateTableAsync<AppUser>().Wait();
this.AppUser = new ObservableCollection<AppUser>(_database.Table<AppUser>());
}
此代码创建一个数据库连接,然后基于AppUser
模型创建一个表。我正在尝试存储最后一行的结果,但遇到以下错误:
CS1503 参数 1:无法从转换
Dialler1.DatabaseConnection.AsyncTableQuery<AppUser>
为System.Collections.Generic.IEnumerable<AppUser>