Пример #1
0
 public bool Update(User user)
 {
     try
     {
         db.Attach(user);
         db.Entry(user).State = EntityState.Modified;
         return(db.SaveChanges() > 0);
     }
     catch (DbUpdateConcurrencyException)
     {
         return(false);
     }
 }
Пример #2
0
 public bool Update(Question someDbObject)
 {
     try
     {
         db.Attach(someDbObject);
         db.Entry(someDbObject).State = EntityState.Modified;
         return(db.SaveChanges() > 0);
     }
     catch (DbUpdateConcurrencyException)
     {
         return(false);
     }
 }
Пример #3
0
        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);
                }
        }
Пример #4
0
        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);
                }
        }