Пример #1
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);
                }
        }
Пример #2
0
        public bool DeleteMarking(Marking marking)
        {
            using var db = new SOContext();
            try
            {
                db.Markings.Remove(marking);
                db.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);

                throw e;
            }
        }