sonarr-repo-only/NzbDrone.Core/Tv/SeasonRepository.cs

27 lines
706 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Datastore;
2013-09-11 06:33:47 +00:00
using NzbDrone.Core.Messaging;
using NzbDrone.Core.Messaging.Events;
2013-03-25 03:51:32 +00:00
namespace NzbDrone.Core.Tv
{
2013-09-10 05:22:38 +00:00
public interface ISeasonRepository : IBasicRepository<Series>
{
List<Season> GetSeasonBySeries(int seriesId);
}
2013-09-10 05:22:38 +00:00
public class SeasonRepository : BasicRepository<Series>, ISeasonRepository
{
public SeasonRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public List<Season> GetSeasonBySeries(int seriesId)
{
2013-09-10 05:22:38 +00:00
return Query.Single(s => s.Id == seriesId).Seasons;
}
}
}