Beispiel #1
0
        public static IEnumerable <TlProvider> CreateTlProviders(ResultsAndCertificationDbContext _dbContext, bool addToDbContext = true)
        {
            var tlProviders = new TlProviderBuilder().BuildList();

            if (addToDbContext)
            {
                _dbContext.AddRangeAsync(tlProviders);
            }
            return(tlProviders);
        }
Beispiel #2
0
        public virtual async Task <int> CreateMany(IList <T> entities)
        {
            await _dbContext.AddRangeAsync(entities);

            try
            {
                return(await _dbContext.SaveChangesAsync());
            }
            catch (DbUpdateException due)
            {
                _logger.LogError(due.Message, due.InnerException);
                throw;
            }
        }