コード例 #1
0
        public async Task <JsonResult> Create(UserCreateViewModel model)
        {
            try
            {
                var user = await service.CreateUser(model.ToDomain());

                await _signInManager.SignInAsync(new ApplicationUser()
                {
                    UserName = user.Email, Id = user.Id.ToString()
                }, isPersistent : false);

                return(Json(new { Success = true, Url = Url.Action("Index", "Home") }));
            }
            catch (Exception ex)
            {
                return(Json(new { Success = false, ex.Message }));
            }
        }