Ejemplo n.º 1
0
        public async Task <IActionResult> CreateAccount([FromBody] PandaAccountCreateContract account)
        {
            if (!ModelState.IsValid)
            {
                return(StatusCode(500,
                                  new
                {
                    Error = ModelState.Values.SelectMany(s => s.Errors.Select(ss => ss.ErrorMessage)).ToList(),
                    Structure = new PandaAccountCreateContract {
                    }
                }
                                  ));
            }
            Results <bool> result = await _accountFacade.CreateAccount(IdentityUser, account);

            if (result.IsError())
            {
                return(StatusCode(500, result));
            }
            return(Ok(result));
        }
Ejemplo n.º 2
0
 public async Task <IActionResult> CreateAccount([FromBody] GenericUserContract newAccount)
 {
     return(Ok(await _accountFacade.CreateAccount(newAccount)));
 }