2013-03-24 04:16:00 +00:00
|
|
|
|
using System.Data;
|
2013-03-25 03:51:32 +00:00
|
|
|
|
using System.Linq;
|
2013-02-24 23:47:57 +00:00
|
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.ExternalNotification
|
|
|
|
|
{
|
|
|
|
|
public interface IExternalNotificationRepository : IBasicRepository<ExternalNotificationDefinition>
|
|
|
|
|
{
|
|
|
|
|
ExternalNotificationDefinition Get(string name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ExternalNotificationRepository : BasicRepository<ExternalNotificationDefinition>, IExternalNotificationRepository
|
|
|
|
|
{
|
2013-03-25 03:51:32 +00:00
|
|
|
|
public ExternalNotificationRepository(IDatabase database)
|
2013-03-24 04:16:00 +00:00
|
|
|
|
: base(database)
|
2013-02-24 23:47:57 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ExternalNotificationDefinition Get(string name)
|
|
|
|
|
{
|
2013-03-25 03:51:32 +00:00
|
|
|
|
return Queryable().SingleOrDefault(c => c.Name.ToLower() == name.ToLower());
|
2013-02-24 23:47:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|