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.
Lidarr/src/NzbDrone.Core/Authentication/UserRepository.cs

32 lines
827 B

using System;
using System.Linq;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
namespace NzbDrone.Core.Authentication
{
public interface IUserRepository : IBasicRepository<User>
{
User FindUser(string username);
User FindUser(Guid identifier);
}
public class UserRepository : BasicRepository<User>, IUserRepository
{
public UserRepository(IMainDatabase database, IEventAggregator eventAggregator)
: base(database, eventAggregator)
{
}
public User FindUser(string username)
{
return Query(x => x.Username == username).SingleOrDefault();
}
public User FindUser(Guid identifier)
{
return Query(x => x.Identifier == identifier).SingleOrDefault();
}
}
}