public bool insertIntoTablePerson(Person person) { try { using (var connection = new SQLiteConnection(System.IO.Path.Combine(folder, "Persons.db"))) { connection.Insert(person); return true; } } catch (SQLiteException ex) { Log.Info("SQLiteEx", ex.Message); return false; } }
обычно, если элемент уже имеет ненулевой PK, он уже существует
if (item.ID != 0) { return database.UpdateAsync(item); } else { return database.InsertAsync(item); }