コード例 #1
0
        public IActionResult Post([FromBody] PostClientAccountRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(Json(ModelState));
            }

            var result = accountServiceRepository.Register(request);

            return(Created("", result));
        }
コード例 #2
0
 public ErrorDto Register(AccountDto account)
 {
     try
     {
         account.Password = account.Password.Encrypt();
         var response = _accountServiceRepository.Register(account);
         if (response.ErrorCode.HasValue)
         {
             return(Validation.TranslateValidationStatusCode(response.ErrorCode.Value));
         }
         return(response);
     }
     catch (Exception ex)
     {
         return(new ErrorDto()
         {
             ErrorMesssage = ex.Message
         });
     }
 }