public bool Update(User user) { try { db.Attach(user); db.Entry(user).State = EntityState.Modified; return(db.SaveChanges() > 0); } catch (DbUpdateConcurrencyException) { return(false); } }
public bool Update(Question someDbObject) { try { db.Attach(someDbObject); db.Entry(someDbObject).State = EntityState.Modified; return(db.SaveChanges() > 0); } catch (DbUpdateConcurrencyException) { return(false); } }
public bool UpdateMarking(Marking marking) { using (var db = new SovaContext()) try { db.Attach(marking); db.Entry(marking).State = EntityState.Modified; return(db.SaveChanges() > 0); } catch (DbUpdateConcurrencyException) { return(false); } }
public bool UpdateAnnotation(Annotation annotation) { using (var db = new SovaContext()) try { annotation.AnnotationCreationDate = db.GetTimestamp(); db.Attach(annotation); db.Entry(annotation).State = EntityState.Modified; return(db.SaveChanges() > 0); } catch (DbUpdateConcurrencyException) { return(false); } }