1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-04 10:02:40 +01:00
Radarr/NzbDrone.Core/Providers/RootDirProvider.cs
Mark McDowall 5a8842e3db AddExisting clears check/hides rows once submitted. Bi-winning
AddNew, currently unable to submit. Bi-polar
2011-03-11 01:04:56 -08:00

49 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Core.Repository;
using SubSonic.Repository;
namespace NzbDrone.Core.Providers
{
public class RootDirProvider : IRootDirProvider
{
private readonly IRepository _sonioRepo;
public RootDirProvider(IRepository sonicRepo)
{
_sonioRepo = sonicRepo;
}
#region IRootDirProvider
public List<RootDir> GetAll()
{
return _sonioRepo.All<RootDir>().ToList();
}
public void Add(RootDir rootDir)
{
_sonioRepo.Add(rootDir);
}
public void Remove(int rootDirId)
{
_sonioRepo.Delete<RootDir>(rootDirId);
}
public void Update(RootDir rootDir)
{
_sonioRepo.Update(rootDir);
}
public RootDir GetRootDir(int rootDirId)
{
return _sonioRepo.Single<RootDir>(rootDirId);
}
#endregion
}
}