2014-06-08 11:22:55 +03:00
|
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Profiles
|
|
|
|
{
|
|
|
|
public interface IProfileRepository : IBasicRepository<Profile>
|
|
|
|
{
|
2015-12-05 12:22:22 +02:00
|
|
|
bool Exists(int id);
|
2014-06-08 11:22:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public class ProfileRepository : BasicRepository<Profile>, IProfileRepository
|
|
|
|
{
|
2015-05-03 21:46:21 +02:00
|
|
|
public ProfileRepository(IMainDatabase database, IEventAggregator eventAggregator)
|
2014-06-08 11:22:55 +03:00
|
|
|
: base(database, eventAggregator)
|
|
|
|
{
|
|
|
|
}
|
2015-12-05 12:22:22 +02:00
|
|
|
|
|
|
|
public bool Exists(int id)
|
|
|
|
{
|
|
|
|
return DataMapper.Query<Profile>().Where(p => p.Id == id).GetRowCount() == 1;
|
|
|
|
}
|
2014-06-08 11:22:55 +03:00
|
|
|
}
|
|
|
|
}
|