Using Services, not Repos

This commit is contained in:
Mark McDowall 2013-04-11 17:36:47 -07:00
commit a6b66b7c90
3 changed files with 30 additions and 14 deletions

View file

@ -13,9 +13,10 @@ namespace NzbDrone.Core.RootFolders
{
List<RootFolder> All();
RootFolder Add(RootFolder rootDir);
void Remove(int rootDirId);
void Remove(int id);
List<UnmappedFolder> GetUnmappedFolders(string path);
Dictionary<string, ulong> FreeSpaceOnDrives();
RootFolder Get(int id);
}
public class RootFolderService : IRootFolderService
@ -66,9 +67,9 @@ namespace NzbDrone.Core.RootFolders
return rootFolder;
}
public virtual void Remove(int rootDirId)
public virtual void Remove(int id)
{
_rootFolderRepository.Delete(rootDirId);
_rootFolderRepository.Delete(id);
}
public virtual List<UnmappedFolder> GetUnmappedFolders(string path)
@ -123,5 +124,10 @@ namespace NzbDrone.Core.RootFolders
return freeSpace;
}
public RootFolder Get(int id)
{
return _rootFolderRepository.Get(id);
}
}
}