1. Johan Driessen
  2. Alpha

Source

Alpha / Alpha.Models / Repositories / UserRepository.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Alpha.Models.Entities;
using Alpha.Models.Extensions;
using Raven.Client;

namespace Alpha.Models.Repositories
{
	public class UserRepository : EntityRepository<User>, IUserRepository
	{
		public UserRepository( IDocumentSession session )
		{
			Session = session;
		}

		public User GetByUsernameAndPassword( string username, string password )
		{
			return Get( u =>
						u.Username == username &&
						u.PasswordHash == password.Sha1() )
					.SingleOrDefault();
		}
	}
}