1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-03-04 02:38:18 +00:00
Radarr/NzbDrone.Core/Indexers/IndexerRepository.cs

34 lines
942 B
C#
Raw Normal View History

2013-04-10 16:44:48 -07:00
using System;
using System.Linq;
2013-02-20 23:07:34 -08:00
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
2013-09-10 23:33:47 -07:00
2013-02-20 23:07:34 -08:00
namespace NzbDrone.Core.Indexers
{
2013-04-07 00:30:37 -07:00
public interface IIndexerRepository : IBasicRepository<IndexerDefinition>
2013-02-20 23:07:34 -08:00
{
2013-04-07 00:30:37 -07:00
IndexerDefinition Get(string name);
2013-04-10 16:44:48 -07:00
IndexerDefinition Find(string name);
2013-02-20 23:07:34 -08:00
}
2013-04-07 00:30:37 -07:00
public class IndexerRepository : BasicRepository<IndexerDefinition>, IIndexerRepository
2013-02-20 23:07:34 -08:00
{
public IndexerRepository(IDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
2013-02-20 23:07:34 -08:00
{
}
2013-04-07 00:30:37 -07:00
public IndexerDefinition Get(string name)
2013-02-20 23:07:34 -08:00
{
2013-04-10 16:44:48 -07:00
return Query.Single(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
2013-02-20 23:07:34 -08:00
}
2013-04-10 16:44:48 -07:00
public IndexerDefinition Find(string name)
{
return Query.SingleOrDefault(i => i.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase));
}
2013-02-20 23:07:34 -08:00
}
}