public async Task <IHttpActionResult> RegisterUser([FromBody] UserRegistration userRegistration) { var result = await _securityManager.CreateUser(userRegistration); if (!result.Exceptions.Any()) { return(Created("security/register", userRegistration)); } return(InternalServerError(new Exception(result.Exceptions.DictionaryToString()))); }