diff options
Diffstat (limited to 'Database/Database.cs')
-rw-r--r-- | Database/Database.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Database/Database.cs b/Database/Database.cs index 2e362af..d2e7e32 100644 --- a/Database/Database.cs +++ b/Database/Database.cs @@ -23,15 +23,15 @@ namespace Database { public virtual DbSet<Article> Articles { get; set; } public virtual DbSet<Config> Configs { get; set; } - public async Task<int> InsertArticles(IEnumerable<Article> articles) { + public async Task InsertArticles(IEnumerable<Article> articles) { foreach (Article article in articles) { try { await Articles.AddAsync(article); + await SaveChangesAsync(); } catch (Microsoft.EntityFrameworkCore.DbUpdateException) { continue; } } - return await SaveChangesAsync(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { |