public async Task <bool> UpdateExamSession(ExamSessionDto examSessionDto)
        {
            var examSession = await MapFromDto(examSessionDto);

            if (examSession == null)
            {
                return(false);
            }
            try
            {
                _context.Update(examSession);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ExamSessionExists(examSessionDto.Id))
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }
            return(true);
        }
示例#2
0
 public async Task <bool> UpdateExamSite(ExamSite examSite)
 {
     try
     {
         _context.Update(examSite);
         await _context.SaveChangesAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         if (!ExamSiteExists(examSite.Id))
         {
             return(false);
         }
         else
         {
             throw;
         }
     }
     return(true);
 }