1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-28 10:51:48 +00:00
Radarr/NzbDrone.Core/Providers/RootDirProvider.cs

46 lines
1,012 B
C#
Raw Normal View History

2011-04-10 02:44:01 +00:00
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Repository;
using SubSonic.Repository;
namespace NzbDrone.Core.Providers
{
2011-04-08 15:10:46 +00:00
public class RootDirProvider
{
private readonly IRepository _sonioRepo;
public RootDirProvider(IRepository sonicRepo)
{
_sonioRepo = sonicRepo;
}
#region IRootDirProvider
2011-04-08 15:10:46 +00:00
public virtual List<RootDir> GetAll()
{
return _sonioRepo.All<RootDir>().ToList();
}
2011-04-08 15:10:46 +00:00
public virtual void Add(RootDir rootDir)
{
_sonioRepo.Add(rootDir);
}
2011-04-10 02:44:01 +00:00
2011-04-08 15:10:46 +00:00
public virtual void Remove(int rootDirId)
{
_sonioRepo.Delete<RootDir>(rootDirId);
}
2011-04-10 02:44:01 +00:00
2011-04-08 15:10:46 +00:00
public virtual void Update(RootDir rootDir)
{
_sonioRepo.Update(rootDir);
}
2011-04-10 02:44:01 +00:00
2011-04-08 15:10:46 +00:00
public virtual RootDir GetRootDir(int rootDirId)
{
return _sonioRepo.Single<RootDir>(rootDirId);
}
#endregion
}
2011-04-10 02:44:01 +00:00
}