Radarr/NzbDrone.Core/ExternalNotification/ExternalNotificationReposit...

24 lines
734 B
C#
Raw Normal View History

2013-03-24 04:16:00 +00:00
using System.Data;
2013-03-25 03:51:32 +00:00
using System.Linq;
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)
{
}
public ExternalNotificationDefinition Get(string name)
{
2013-03-25 03:51:32 +00:00
return Queryable().SingleOrDefault(c => c.Name.ToLower() == name.ToLower());
}
}
}