vgquotes/Src/VideoGameQuotes.Api/Persistence/IUserRepository.cs

18 lines
506 B
C#
Raw Normal View History

2011-02-10 04:39:59 +00:00
using System.Linq;
using NHibernate;
using Portoa.NHibernate;
using Portoa.Persistence;
namespace VideoGameQuotes.Api.Persistence {
public interface IUserRepository : IRepository<User> {
User FindByUsername(string name);
}
public class UserRepository : NHibernateRepository<User>, IUserRepository {
public UserRepository(ISession session) : base(session) { }
public User FindByUsername(string name) {
return Records.FirstOrDefault(user => user.Username == name);
}
}
}