2013-02-21 08:07:34 +01:00
|
|
|
|
using System;
|
2013-03-24 05:16:00 +01:00
|
|
|
|
using System.Data;
|
2013-02-21 08:07:34 +01:00
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers
|
|
|
|
|
{
|
|
|
|
|
public interface IIndexerRepository : IBasicRepository<Indexer>
|
|
|
|
|
{
|
|
|
|
|
Indexer Find(Type type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class IndexerRepository : BasicRepository<Indexer>, IIndexerRepository
|
|
|
|
|
{
|
2013-03-24 05:16:00 +01:00
|
|
|
|
public IndexerRepository(IDbConnection database)
|
|
|
|
|
: base(database)
|
2013-02-21 08:07:34 +01:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Indexer Find(Type type)
|
|
|
|
|
{
|
2013-03-24 05:16:00 +01:00
|
|
|
|
return Single(i => i.Type == type.ToString());
|
2013-02-21 08:07:34 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|