示例#1
0
        public void DeleteTest(SpellTest spellTest)
        {
            if (spellTest.TestOccurances != null)
            {
                foreach (var o in spellTest.TestOccurances)
                {
                    var ta = _context.TestAnswer.Where(a => a.TestOccuranceId == o.Id).ToList();
                    _context.TestAnswer.RemoveRange(ta);
                }

                _context.TestOccurance.RemoveRange(spellTest.TestOccurances);
            }

            if (spellTest.Spellings != null)
            {
                _context.Spelling.RemoveRange(spellTest.Spellings);
            }

            _context.SpellTest.Remove((spellTest));

            _context.SaveChanges();
        }
示例#2
0
 public void AddTest(SpellTest test)
 {
     throw new NotImplementedException();
 }
示例#3
0
 public void AddTest(SpellTest test)
 {
     _context.SpellTest.Add(test);
     _context.SaveChanges();
 }
示例#4
0
 public void UpdateTest(SpellTest test)
 {
     //_context.SpellTest.Attach(test);
     _context.SaveChanges();
 }
示例#5
0
 protected void OnDeleteEntireTest(SpellTest spellTest)
 {
     _repo.DeleteTest(spellTest);
     SpellingDeleted();
     DeleteDone();
 }