Exemplo n.º 1
0
        public async Task <IActionResult> RegisterNewUser(RegisterView model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    var data = new Register {
                        UserName  = model.UserName,
                        UserEmail = model.UserEmail,
                        Password  = model.Password,
                        Status    = model.Status,
                        Role      = model.Role
                    };
                    var Result = await context.AddRegister(data);

                    return(RedirectToAction("Index", "Home"));
                }
                return(View(model));
            }
            catch (Exception)
            {
                return(Ok());
            }
        }