You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NzbDrone.Core.Repository;
|
|
using SubSonic.Repository;
|
|
|
|
namespace NzbDrone.Core.Providers
|
|
{
|
|
public class RootDirProvider
|
|
{
|
|
private readonly IRepository _sonioRepo;
|
|
|
|
public RootDirProvider(IRepository sonicRepo)
|
|
{
|
|
_sonioRepo = sonicRepo;
|
|
}
|
|
|
|
#region IRootDirProvider
|
|
|
|
public virtual List<RootDir> GetAll()
|
|
{
|
|
return _sonioRepo.All<RootDir>().ToList();
|
|
}
|
|
|
|
public virtual int Add(RootDir rootDir)
|
|
{
|
|
return Convert.ToInt32(_sonioRepo.Add(rootDir));
|
|
}
|
|
|
|
public virtual void Remove(int rootDirId)
|
|
{
|
|
_sonioRepo.Delete<RootDir>(rootDirId);
|
|
}
|
|
|
|
public virtual void Update(RootDir rootDir)
|
|
{
|
|
_sonioRepo.Update(rootDir);
|
|
}
|
|
|
|
public virtual RootDir GetRootDir(int rootDirId)
|
|
{
|
|
return _sonioRepo.Single<RootDir>(rootDirId);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
} |