public int Post([FromBody] Auth.Models.User value)
        {
            TestContext context = HttpContext.RequestServices.GetService(typeof(Auth.Models.TestContext)) as TestContext;
            int         s       = context.ForgetPassword(value);

            return(s);
        }
        public String Post([FromBody] Auth.Models.User value)
        {
            TestContext context = HttpContext.RequestServices.GetService(typeof(Auth.Models.TestContext)) as TestContext;
            String      s       = context.PostUser(value);

            return(s);
        }
Exemple #3
0
        public static ViewUser GetViewUserFromEntityUser(User user)
        {
            ViewUser vuser = new ViewUser()
            {
                Name = user.Name
            };

            return vuser;
        }
Exemple #4
0
        public async Task<ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                // Create a local login before signing in the user
                var user = new User(model.UserName);
                var result = await IdentityManager.Users.CreateLocalUserAsync(user, model.Password);
                if (result.Success)
                {
                    await IdentityManager.Authentication.SignInAsync(AuthenticationManager, user.Id, isPersistent: false);
                    return RedirectToAction("Index", "Home");
                }
                else
                {
                    AddErrors(result);
                }
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }