public async Task AddAsync(CorrectResponses CorrectResponses)
 {
     try
     {
         await m_repository.CreateAsync(CorrectResponses);
     }
     catch (ValidationException e)
     {
         m_logger.LogWarning(e, "A validation failed");
         throw;
     }
     catch (Exception e) when(e.GetType() != typeof(ValidationException))
     {
         m_logger.LogCritical(e, $"Unexpected Exception while trying to create a CorrectResponses with the properties : {JsonConvert.SerializeObject(CorrectResponses, Formatting.Indented)}");
         throw;
     }
 }
Пример #2
0
 public async Task DeleteAsync(CorrectResponses entity)
 {
     m_dataContext.CorrectResponses.Remove(entity);
     await m_dataContext.SaveChangesAsync();
 }
Пример #3
0
        public async Task CreateAsync(CorrectResponses entity)
        {
            await m_dataContext.CorrectResponses.AddAsync(entity);

            await m_dataContext.SaveChangesAsync();
        }