public void UpdateInTable() { using (var db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path)) { db.Update(this); } }
//Inserts a new customer if the customer is not already in the table, if it is, it updates it. public void AddToTable() { using (var db = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(), path)) { //Look for customer in table Customer returnedCustomer = (from s in db.Table <Customer>() where s.Id.Equals(Id) select s).FirstOrDefault(); if (returnedCustomer != null) { //Add new items to items in items column. this.Items = returnedCustomer.Items + "\r(" + DateTime.Now.ToLocalTime().ToString("d") + ")\r" + this.Items; db.Update(this); } else { db.Insert(this); } } }
public void Update(Cliente cliente) { _conexao.Update(cliente); }
public void Update <T>(T model) { connection.Update(model); }