Example #1
0
        public async Task <IResult> RegisterUserAsync([FromBody] UserRegisterWriteModel userRegister)
        {
            if (!ModelState.IsValid)
            {
                var errors = ModelState.Values.SelectMany(v => v.Errors).Select(v => v.ErrorMessage).ToArray();
                return(CreateResult(ResultStateEnum.Failed, errors));
            }

            var gravatarUrl = GravatarHelper.CreateGravatarUrl(userRegister.UserName);

            userRegister.Gravatar = await _httpService.GetByteArrayAsync(gravatarUrl);

            return(await _userAuthDomainServiceProxy.CreateUserAsync(userRegister));
        }