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 DeleteMarking(Marking marking) { using var db = new SOContext(); try { db.Markings.Remove(marking); db.SaveChanges(); return(true); } catch (Exception e) { return(false); throw e; } }