예제 #1
0
        public async Task <IActionResult> CreatePhotographAsync([FromForm] CreatePhotographInput input)
        {
            Result <string> result = await _userAccount.CreatePhotographAsync(input);

            if (result.Success)
            {
                return(Ok(result));
            }
            else
            {
                return(BadRequest(result));
            }
        }
예제 #2
0
        public async Task <Result <string> > CreatePhotographAsync(CreatePhotographInput input)
        {
            PHOTOnlineUser user = new PHOTOnlineUser()
            {
                FirstName = input.FirstName,
                LastName  = input.LastName,
                Email     = input.Email,
                UserName  = input.Username,
                UserType  = UserType.Photograph
            };

            Result <string> result = await
                                     _authService.CreateUserAsync(user, input.Password);

            await _authService.AddUserToRoleByEmail(
                input.Email, UserType.Photograph.ToString());

            return(result);
        }