Exemplo n.º 1
0
        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("/");
        }
Exemplo n.º 2
0
 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;
 }