public ActionResult SignIn(SignInModel model)
 {
     if (ModelState.IsValid)
     {
         User user;
         if (SignInUser(model, out user))
         {
             _service.SignIn(user, model.RememberMe);
             return Redirect(GetRedirectUrl(model.ReturnUrl));
         }
         else
             ModelState.AddModelError("password", "Wrong username or password!");
     }
     return View(model);
 }
 private bool SignInUser(SignInModel model, out User user)
 {
     user = RavenSession.Query<User>().FirstOrDefault(x => x.Name == model.Username);
     return user != null && user.Password == model.Password;
 }