using System.Linq; using NHibernate; using Portoa.NHibernate; using Portoa.Persistence; namespace VideoGameQuotes.Api.Persistence { public interface IUserRepository : IRepository { User FindByUsername(string name); } public class UserRepository : NHibernateRepository, IUserRepository { public UserRepository(ISession session) : base(session) { } public User FindByUsername(string name) { return Records.FirstOrDefault(user => user.Username == name); } } }