public IActionResult Post([FromBody] PostClientAccountRequest request) { if (!ModelState.IsValid) { return(Json(ModelState)); } var result = accountServiceRepository.Register(request); return(Created("", result)); }
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 }); } }