2013-02-19 18:05:15 -08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using NzbDrone.Core.Datastore;
|
2013-09-10 23:33:47 -07:00
|
|
|
using NzbDrone.Core.Messaging;
|
2013-03-24 20:51:32 -07:00
|
|
|
|
2013-02-19 18:05:15 -08:00
|
|
|
|
|
|
|
namespace NzbDrone.Core.Tv
|
|
|
|
{
|
2013-09-09 22:22:38 -07:00
|
|
|
public interface ISeasonRepository : IBasicRepository<Series>
|
2013-02-19 18:05:15 -08:00
|
|
|
{
|
|
|
|
List<Season> GetSeasonBySeries(int seriesId);
|
|
|
|
}
|
|
|
|
|
2013-09-09 22:22:38 -07:00
|
|
|
public class SeasonRepository : BasicRepository<Series>, ISeasonRepository
|
2013-02-19 18:05:15 -08:00
|
|
|
{
|
2013-05-05 14:24:33 -07:00
|
|
|
public SeasonRepository(IDatabase database, IMessageAggregator messageAggregator)
|
|
|
|
: base(database, messageAggregator)
|
2013-02-19 18:05:15 -08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Season> GetSeasonBySeries(int seriesId)
|
|
|
|
{
|
2013-09-09 22:22:38 -07:00
|
|
|
return Query.Single(s => s.Id == seriesId).Seasons;
|
2013-02-19 18:05:15 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|