2013-02-21 10:07:34 +03:00
|
|
|
using System;
|
2013-03-24 07:16:00 +03:00
|
|
|
using System.Data;
|
2013-03-25 06:51:32 +03:00
|
|
|
using System.Linq;
|
2013-02-21 10:07:34 +03: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-25 06:51:32 +03:00
|
|
|
public IndexerRepository(IDatabase database)
|
2013-03-24 07:16:00 +03:00
|
|
|
: base(database)
|
2013-02-21 10:07:34 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public Indexer Find(Type type)
|
|
|
|
{
|
2013-03-27 06:44:52 +03:00
|
|
|
return Query.Single(i => i.Type == type.ToString());
|
2013-02-21 10:07:34 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|