public ActionResult Register(RegisterViewModel model)
        {
            RegisterResult result = _accountFacade.Register(Mapper.Map <RegisterData>(model));

            if (result.Success)
            {
                return(RedirectToRoute("RegisterSuccess"));
            }

            model.ErrorMessage = result.ErrorMessage;
            return(View(model));
        }
Exemple #2
0
        public async Task <JsonResult> Register([FromBody] RegisterViewModel registerViewModel)
        {
            try
            {
                var token = await _accountFacade.Register(registerViewModel);

                return(Json(token));
            }
            catch (RegistrationErrorException e)
            {
                Response.StatusCode = (int)HttpStatusCode.BadRequest;
                return(Json(e.Message));
            }
            catch (Exception e)
            {
                Response.StatusCode = 500;
                return(Json(e.Message));
            }
        }
Exemple #3
0
        public RegisterResponse Register([FromBody] RegisterRequest request)
        {
            RegisterResponse response = _accountFacade.Register(request);

            return(response);
        }