public User GetUser(string username, string password) { using (var userRepository = new RepositoryFactory().CreateUserRepository()) { return userRepository.GetByUsernameAndPassword(username, password); } }