First pass at the plex update service

This commit is contained in:
tidusjar 2016-03-07 13:08:30 +00:00
commit 7636409790
25 changed files with 661 additions and 16 deletions

View file

@ -26,6 +26,7 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Dapper.Contrib.Extensions;
@ -89,5 +90,19 @@ namespace PlexRequests.Store
return db.Update(entity);
}
}
public bool UpdateAll(IEnumerable<T> entity)
{
var result = new HashSet<bool>();
using (var db = Config.DbConnection())
{
db.Open();
foreach (var e in entity)
{
result.Add(db.Update(e));
}
}
return result.All(x => true);
}
}
}

View file

@ -61,5 +61,12 @@ namespace PlexRequests.Store
/// <param name="entity">The entity.</param>
/// <returns></returns>
bool Update(T entity);
/// <summary>
/// Updates all.
/// </summary>
/// <param name="entity">The entity.</param>
/// <returns></returns>
bool UpdateAll(IEnumerable<T> entity);
}
}

View file

@ -92,6 +92,11 @@ namespace PlexRequests.Store
return db.Update(entity);
}
}
public bool UpdateAll(IEnumerable<T> entity)
{
throw new NotSupportedException();
}
}
}