1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-01-02 13:24:33 +00:00
Radarr/NzbDrone.Core/ReferenceData/SceneMappingRepository.cs
2013-03-25 23:19:55 -07:00

31 lines
No EOL
837 B
C#

using System.Data;
using System.Linq;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.ReferenceData
{
public interface ISceneMappingRepository : IBasicRepository<SceneMapping>
{
SceneMapping FindByTvdbId(int tvdbId);
SceneMapping FindByCleanTitle(string cleanTitle);
}
public class SceneMappingRepository : BasicRepository<SceneMapping>, ISceneMappingRepository
{
public SceneMappingRepository(IDatabase database)
: base(database)
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
return Queryable().SingleOrDefault(c => c.TvdbId == tvdbId);
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
return Queryable().SingleOrDefault(c => c.CleanTitle == cleanTitle);
}
}
}