This commit is contained in:
tidusjar 2016-06-13 13:01:22 +01:00
commit 3e16d8acf0
18 changed files with 399 additions and 57 deletions

View file

@ -25,13 +25,15 @@
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PlexRequests.Services.Interfaces;
using PlexRequests.Store.Models;
using PlexRequests.Store.Repository;
namespace PlexRequests.Services
namespace PlexRequests.Services.Jobs
{
public class JobRecord : IJobRecord
{
@ -39,7 +41,9 @@ namespace PlexRequests.Services
{
Repo = repo;
}
private IRepository<ScheduledJobs> Repo { get; }
public void Record(string jobName)
{
var allJobs = Repo.GetAll();
@ -55,5 +59,15 @@ namespace PlexRequests.Services
Repo.Insert(job);
}
}
public async Task<IEnumerable<ScheduledJobs>> GetJobsAsync()
{
return await Repo.GetAllAsync();
}
public IEnumerable<ScheduledJobs> GetJobs()
{
return Repo.GetAll();
}
}
}