public ActionResult Index() { //create admin role //_Roles.CreateRole(MvcApplication.ApplicationName, "Admin"); var user =RavenSession.Query<User>().FirstOrDefault(x => x.Name == "admin"); if (user == null) { User admin = new User { Name = "admin", Email = "*****@*****.**", Password = "******" }; RavenSession.Store(admin); TempData["message"] = "Admin user setup"; } return Redirect("/"); }
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; }