You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/src/NzbDrone.Core/Applications/AppIndexerMapRepository.cs

31 lines
857 B

using System.Collections.Generic;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Applications
{
public interface IAppIndexerMapRepository : IBasicRepository<AppIndexerMap>
{
List<AppIndexerMap> GetMappingsForApp(int appId);
void DeleteAllForApp(int appId);
}
public class AppIndexerMapRepository : BasicRepository<AppIndexerMap>, IAppIndexerMapRepository
{
public AppIndexerMapRepository(IMainDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public void DeleteAllForApp(int appId)
{
Delete(x => x.AppId == appId);
}
public List<AppIndexerMap> GetMappingsForApp(int appId)
{
return Query(x => x.AppId == appId);
}
}
}