I recently moved across from SQLite.NET to SQLite-net-pcl due to the Android 7.0 SQlite issue.
In the process I have updated all my libraries and all is working well with regards to insert/drop etc.
The only issue I have is that every time I retrieve an item from the DB it always has an ID of 0. This is causing problems with updating items. Has anyone had this issue before?
[SQLite.PrimaryKey, SQLite.AutoIncrement] public int ID { get; set; } public string objectId { get; set; } public DateTime createdAt { get; set; } public DateTime updatedAt { get; set; } public string Title { get; set; } Thanks in advance.
InsertOrReplacewith anAutoIncrementprimary key. It will always override item with id 0 and never insert a new one.SQLite.Net, in your sample you're usingSQLite, maybe your primary key attribute is not being recognized.IDnullable;public int? ID { get; set; }[Column("<column_name>")]