From 7beffadae9179095b39eff36a708e3d508ee21fd Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Sun, 10 Feb 2019 15:34:18 +0000 Subject: Made return for InsertArticles records written --- Database/Database.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Database/Database.cs b/Database/Database.cs index 9a78988..d3ccb2e 100644 --- a/Database/Database.cs +++ b/Database/Database.cs @@ -23,12 +23,12 @@ namespace Database { public virtual DbSet
Articles { get; set; } public virtual DbSet Configs { get; set; } - public async void InsertArticles(IEnumerable
articles) { + public async Task InsertArticles(IEnumerable
articles) { try { await Articles.AddRangeAsync(articles); - await SaveChangesAsync(); + return await SaveChangesAsync(); } catch (Microsoft.EntityFrameworkCore.DbUpdateException) { - return; // duplicate title id's + return -1; // duplicate title id's } } -- cgit v1.2.3-13-gbd6f