public bool Update(tb_Carts entity) { try { db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
public void SaveValue(string Key, string Value) { var meta = db.tb_Settings.Where(x => x.Name == Key).SingleOrDefault(); if (meta == null) { meta = new tb_Settings(); meta.Name = Key; meta.Content = Value; meta.Status = true; db.tb_Settings.Add(meta); db.SaveChanges(); } else { meta.Name = Key; meta.Content = Value; db.Entry(meta).State = EntityState.Modified; db.SaveChanges(); } }
public bool Update(tb_Roles entity) { db.Entry(entity).State = EntityState.Modified; db.SaveChanges(); return(true); }