Beispiel #1
0
        public async Task DeleteSubject(int teacherID, string subjectTitle)
        {
            int subjectID = await _context.Subject.Where(s => s.Title.Equals(subjectTitle)).Select(s => s.Subjectid).FirstOrDefaultAsync();

            Teaching teaching = await _context.Teaching.Where(t => t.Userid == teacherID && t.Subjectid == subjectID).FirstOrDefaultAsync();

            _context.Remove(teaching);
            await _context.SaveChangesAsync();
        }
Beispiel #2
0
 //deletes request if it is denied
 public async Task DenyNewSubjectRequest(int requestID)
 {
     _context.Remove(await GetSubjectRequestByID(requestID));
     await _context.SaveChangesAsync();
 }