Ejemplo n.º 1
0
        public bool DeleteMarking(Marking marking)
        {
            using var db = new SovaDbContext();
            var result = db.Markings.Find(marking.UserEmail, marking.QuestionId);

            if (result == null)
            {
                return(false);
            }
            db.Markings.Remove(result);
            return(db.SaveChanges() > 0);
        }
Ejemplo n.º 2
0
 public Marking CreateMarking(Marking marking)
 {
     using var db = new SovaDbContext();
     try
     {
         db.Markings.Add(marking);
         db.SaveChanges();
         return(marking);
     }
     catch (Exception e)
     {
         return(null);
     }
 }