Fixed issue with saving to db

This commit is contained in:
tidusjar 2016-08-05 20:36:24 +01:00
parent f60e880da5
commit 131a99b1bb
3 changed files with 3 additions and 9 deletions

View file

@ -289,14 +289,8 @@ namespace PlexRequests.Store.Repository
ResetCache();
using (var db = Config.DbConnection())
{
var result = enumerable.Sum(e => db.Insert(e));
var format = values.AddPrefix("@", ",");
var processQuery = $"INSERT INTO {tableName} VALUES ({format})";
var result = 0;
foreach (var e in enumerable)
{
result += db.Execute(processQuery, e);
}
return result == enumerable.Length;
}